Join our Newsletter — 33% off our NHI Course
Home› Glossary› Cyber Security› Local Infile
Cyber Security

Local Infile

← Back to Glossary
By NHI Mgmt Group Updated November 25, 2026 Domain: Cyber Security

LOCAL INFILE is a database client capability that lets the server request a local file from the client machine during a bulk load operation. In practice, the client sends file contents to the server after receiving the request, so access controls must restrict it because it can expose files if enabled too broadly.

What Local Infile Means in a Database

Local infile is a client-side file transfer path in a bulk load workflow, not a normal application data fetch. The server asks the client machine for a file, and the client sends the file contents back, so the security boundary is the client host as much as the database server.

That design makes local file handling part of the database trust model. If the feature is enabled too broadly, a server that should only receive imported data can also induce a client to disclose local files that the client process can read.

Why Local Infile Is Security-Sensitive

The main security issue is that a bulk-load convenience feature can become a file disclosure path. If an application, proxy, or server endpoint can trigger local infile unexpectedly, the database client may expose configuration files, logs, export files, or other readable local content.

This is why local infile is usually treated as a restricted capability rather than a default convenience setting. The risk is not just accidental exposure, but also misuse of a trusted data-loading path that may bypass the scrutiny applied to ordinary uploads or application requests.

In MySQL environments, file-related hardening is usually considered alongside other controls such as file privilege restrictions and secure transport settings, because database clients and servers often need layered constraints rather than one isolated toggle. MySQL Security Guide

How Organisations Control Exposure

Exposure assessment starts with knowing where the capability is enabled in drivers, clients, connection strings, and server-side settings. Teams should also confirm which database endpoints, automation jobs, and third-party tools can invoke bulk load behaviour, because local infile only matters where that path is reachable.

The practical question is whether the feature is required at all. If it is needed, the safer pattern is to limit it to known workflows and known files, then align that control with host hardening, file permissions, and database-side restrictions so the client cannot become a broad file source.

In MySQL hardening, this kind of review sits naturally beside account, privilege, and file-access controls, because the blast radius depends on both who can connect and what local files a connected client can read. The MySQL Security Guide covers these adjacent safeguards in one place.

Detection, Investigation, and Recovery

Because local infile is a feature-level risk, detection often begins with configuration review rather than malware-style alerts. Administrators should look for unexpected use of bulk load operations, unusual file-loading errors, and client or server logs that show a load request where one was not expected.

After suspected abuse, the most important recovery question is whether sensitive local files were available to the affected client context. If so, the response may need to extend beyond database review to include credential rotation, log inspection, and validation that no secondary systems consumed the exposed data.

Where the feature is part of a database platform that also supports auditing, that telemetry helps distinguish legitimate import activity from suspicious file-transfer behaviour. If the database cannot show who invoked the path or what files were requested, the organisation may need compensating monitoring elsewhere.

Risk and Threat Considerations

Local infile can turn a trusted database import feature into a data exposure path when a server or intermediary can request files from a client machine. The danger increases when the client process has access to sensitive working directories, cached credentials, export files, or automation artefacts.

Failure mechanism: An attacker, malicious server, or misconfigured integration triggers a bulk load request that causes the client to read and transmit a local file the operator never intended to expose.

Impact: The result can be disclosure of configuration data, embedded secrets, local data extracts, or other readable content, followed by broader compromise if the exposed material helps an attacker move further into the environment.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

NIST SP 800-53 Rev 5 and CIS Controls v8 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
NIST SP 800-53 Rev 5AC-6 — Least PrivilegeLocal infile should be limited to only the clients and workflows that need file-loading.
CM-7 — Least FunctionalityThe feature adds unnecessary exposure when bulk file loading is not required.
AU-2 — Event LoggingImport and file-request activity needs logging to spot unexpected use of the feature.
Recommendation — Restrict local infile to the minimum required users, hosts, and workflows. Disable local infile unless a documented business need exists. Log bulk load and file-transfer events that involve local infile.
CIS Controls v8CIS-4 — Secure Configuration of Enterprise Assets and SoftwareDatabase client and server settings must be hardened to prevent broad file-loading exposure.
Recommendation — Harden database clients and servers so local infile is not broadly enabled.

Practitioner Guidance

What to watch for: Treat local infile as an exception-based capability. If a workload does not explicitly need client-to-server file loading, disable it or keep it tightly scoped, then verify that drivers, connection settings, and server policy all agree.

Governance implication: Ownership should sit with both database and platform teams, because the control spans client configuration, server configuration, and file-system access on the host that runs the client. One team controlling only one side leaves a gap.

Practitioner takeaway: The safest posture is to assume that any enabled local infile path is a file disclosure surface and to document exactly which applications, users, and files are allowed to use it.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Reviewed and updated by the NHIMG editorial team on November 25, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org