Join our Newsletter — 33% off our NHI Course
Threats, Abuse & Incident Response

AF_ALG

← Back to Glossary
By NHI Mgmt Group Updated August 28, 2026 Domain: Threats, Abuse & Incident Response

AF_ALG is a Linux kernel interface that exposes cryptographic algorithms to userspace. When it is used in vulnerable paths, it can become part of a privilege-escalation chain rather than a simple service interface, especially when kernel memory handling is unsafe.

Expanded Definition

AF_ALG is a Linux kernel crypto interface that lets userspace call kernel-backed cryptographic algorithms through socket-style operations. In benign use, it can centralise acceleration and reduce duplicated crypto code, but in security analysis it must be treated as a kernel attack surface, not just an application API.

Its relevance in NHI security comes from the fact that modern agents, service accounts, and privileged automation often execute on Linux hosts where kernel interfaces are reachable from containerized workloads, build runners, or orchestration nodes. The interface itself is not a vulnerability, but vulnerable code paths around it can become a pivot point for privilege escalation when memory safety, input validation, or boundary handling fails. That is why AF_ALG is best understood alongside NIST Cybersecurity Framework 2.0 style hardening and kernel attack-surface reduction, rather than as a standalone crypto feature.

Definitions vary across vendors when AF_ALG is discussed in exploit writeups because some focus on cryptographic offload, while others focus on kernel exposure and exploitability. The most common misapplication is treating AF_ALG as a harmless library substitute, which occurs when teams grant container or service workloads unnecessary access to kernel facilities without evaluating privilege boundaries.

Examples and Use Cases

Implementing AF_ALG-aware controls rigorously often introduces operational friction, requiring organisations to weigh kernel performance benefits against the cost of tighter isolation, more review gates, and reduced flexibility for automation.

  • A CI runner executing signing or hashing jobs reaches AF_ALG through a container escape path, turning a routine crypto call into a kernel escalation opportunity.
  • A privileged maintenance agent uses AF_ALG for accelerated encryption on a host that also stores secrets, increasing the impact if the agent is compromised.
  • A service account with broad Linux capabilities is allowed to access crypto sockets even though the workload does not require direct kernel crypto access.
  • An exploit chain combines unsafe kernel memory handling with AF_ALG interaction to move from local code execution to elevated privileges.
  • An organisation reviews AF_ALG exposure during hardening and pairs that review with secret hygiene guidance from Ultimate Guide to NHIs and identity governance practices.

For implementation context, teams often compare this interface with broader Linux privilege and identity controls documented in the NIST Cybersecurity Framework 2.0, especially when deciding whether a workload should reach kernel services at all.

Why It Matters in NHI Security

AF_ALG matters because NHI compromises rarely stay at the application layer. A service account, agent, or automation pipeline that can invoke kernel interfaces may become the bridge from ordinary workload execution to host takeover if the surrounding environment is weakly isolated. In NHI programs, the danger is not only the interface itself, but the privilege, secret, and runtime context in which it is reachable.

NHI Management Group research shows that 97% of NHIs carry excessive privileges, and 96% of organisations store secrets outside secrets managers in vulnerable locations including code, config files, and CI/CD tools. Those conditions matter here because a compromised automation identity can expose the host, and a vulnerable host can then expose more identities and secrets. The right control posture is to minimize workload privilege, restrict kernel-facing capabilities, and treat any crypto or memory-safety issue as part of an identity attack path, not just a systems bug. The Ultimate Guide to NHIs is especially relevant when teams need a governance lens for these chained risks.

Organisations typically encounter the operational significance of AF_ALG only after a container breakout, kernel exploit, or privileged agent compromise, at which point the interface becomes operationally unavoidable to address.

Standards & Framework Alignment

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

OWASP Non-Human Identity Top 10 and OWASP Agentic AI Top 10 address the attack and risk surface, while NIST CSF 2.0, NIST Zero Trust (SP 800-207) and NIST AI RMF set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP Non-Human Identity Top 10NHI-01Covers attack paths where non-human identities gain dangerous runtime or platform reach.
NIST CSF 2.0PR.AC-3Least-privilege access directly applies to workloads that can touch kernel crypto interfaces.
NIST Zero Trust (SP 800-207)SC.POZero Trust treats kernel and workload trust as explicit policy decisions, not implicit access.
NIST AI RMFAI systems running on Linux inherit host risk, including kernel attack surfaces like AF_ALG.
OWASP Agentic AI Top 10Agentic systems may invoke privileged OS interfaces and widen escalation chains.

Limit AF_ALG exposure to only the workloads that truly require it and review entitlements regularly.

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