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

Sink

← Back to Glossary
By NHI Mgmt Group Updated October 30, 2026 Domain: Cyber Security

A sink is a point in code where input stops being inert data and becomes an action, such as a database query, shell command, or file write. Runtime controls focus on sinks because that is where a benign-looking request can turn into a security incident.

What a sink does in practice

A sink is the moment a program stops just handling input and starts doing something with authority. That action might be a database query, a shell command, a file write, a template render, or an API call. Because sinks convert data into execution, they are the places where a harmless-looking string can become a security event.

Sinks matter because they define the boundary between inspection and impact. Upstream code can often treat input as inert, but once data reaches a sink, the code must assume the input may be hostile, malformed, or deliberately structured to alter program behaviour.

Why sinks are the focus of secure coding

Security review often centres on sinks because they are the point at which validation, escaping, parameterisation, and allowlisting either succeed or fail. A string that is safe in memory can become dangerous when it reaches a command interpreter, SQL engine, deserialiser, file system, or browser context. The same input may be benign in one sink and exploitable in another.

This is why secure design talks about context, not just input. A sink determines what kind of interpretation happens, and that interpretation defines the attack surface. For example, a database sink needs parameterised queries; a shell sink needs strict command construction; a file sink needs path control and destination validation.

OWASP API Security Top 10 is useful here because many API failures become dangerous only when user-controlled data reaches a privileged backend sink.

Common sink patterns and how they differ

Not all sinks behave the same way. A database sink can turn input into data retrieval or modification. A command sink can turn input into operating-system execution. A file sink can create, overwrite, or read content. A logging sink is usually lower risk, but it still matters when logs are later parsed, replayed, or displayed in a trusted interface.

The key question is whether the sink merely stores data or interprets it. Interpretation increases risk, especially when the sink has access to secrets, credentials, filesystem paths, or administrative functions. That is why sink analysis is a core technique in injection testing and secure code review.

OWASP Non-Human Identity Top 10 also becomes relevant when a sink uses service credentials, tokens, or automation accounts to perform the underlying action.

Why sink awareness changes defensive thinking

Once teams identify sinks explicitly, they can review code by trust boundary rather than by feature name. That makes it easier to see where input becomes executable, where output becomes executable, and where a control failure would create real impact. Sink-focused review also helps teams distinguish between sanitising input and validating the action that the sink will perform.

The most useful habit is to ask what authority the sink carries. A sink that runs locally with low privilege is different from one that can modify production data, execute scripts, or write into a path later consumed by another service. The more privilege or downstream trust a sink has, the more carefully it must be constrained.

For broader control mapping, NIST SP 800-53 Rev 5 Security and Privacy Controls provides the control vocabulary for access control, integrity, auditing, and secure configuration around such execution points.

Risk and Threat Considerations

Sinks are attractive to attackers because they are where input gains effect. If a developer assumes a field is just text when it actually reaches a command, query, or file sink, the attacker can often turn that mismatch into injection, data tampering, code execution, or unauthorised file access.

Failure mechanism: The security failure happens when untrusted input is passed into a sink that interprets it as instructions or structured content, rather than as inert data. That can let hostile input change query logic, command flow, file paths, or rendered output.

Impact: Depending on the sink, the result can include data breach, privilege misuse, persistence, destructive writes, or remote code execution, especially when the sink inherits high trust from the surrounding application or service account.

Standards & Framework Alignment

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

OWASP API Security Top 10 addresses the attack and risk surface, while NIST SP 800-53 Rev 5, NIST CSF 2.0 and OWASP ASVS set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP API Security Top 10API8 — Security MisconfigurationSinks are often exploitable when backend endpoints are exposed without proper hardening.
Recommendation — Harden exposed API sinks so user input cannot alter privileged backend behaviour.
NIST SP 800-53 Rev 5SI-10 — Information Input ValidationSinks depend on validating data before it reaches interpreters or execution points.
AC-6 — Least PrivilegeSink impact depends on the privilege of the account or service performing the action.
Recommendation — Validate input before it reaches an interpreter, query engine, file path, or command sink. Limit the authority of the account behind each sink so compromise has less impact.
NIST CSF 2.0PR.DS-1 — Data-at-rest is protectedFile and storage sinks create protection requirements for data written by the application.
Recommendation — Protect data written through file and storage sinks with appropriate access and safeguards.
OWASP ASVSV15 — Secure Coding and ArchitectureSink safety is a core application security design concern.
Recommendation — Design application flows so untrusted input cannot reach dangerous sinks unsafely.

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 October 30, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org