Suspicious Binary Execution via Path Alias


Description

Detects execution of binaries through the /proc/self/root procfs path alias. This technique resolves to the filesystem root through procfs and can bypass path-based denylists or security controls that match on canonical paths like /usr/bin/. An AI coding agent (Claude Code) was observed using this technique autonomously to evade its own permission denylist without any adversarial prompting. This is also a general defense evasion technique usable by any process.

Query · eql

process where event.type == "start" and event.action == "exec" and
(
  process.executable like "/proc/*/root/*" or
  process.args regex """/proc/(self|[0-9]{1,7})/root/[a-z].*"""
) and
not (
  process.args like ("/proc/*/root/etc/*", "/proc/1/root/var/lib/rancher/*", "/proc/1/root/var/lib/cni/*", "cat", "readlink", "ls") or
  process.executable == "./opt/spire/bin/spire-server" or
  process.parent.command_line == "runc init" or
  (process.executable == "/usr/bin/slirp4netns" and process.parent.executable == "/usr/bin/rootlesskit") or
  (
    process.parent.command_line == "/usr/bin/perl /usr/bin/pve8to9 --full" and
    process.executable == "/usr/bin/x86_64-linux-gnu-objdump"
  )
)
Raw source Suspicious Binary Execution via Path Alias · Elastic TOML
Esc
Published by elastic/protections-artifacts ↗, licensed under Elastic License 2.0 ↗. Reproduced here unmodified.
[rule]
description = """
Detects execution of binaries through the /proc/self/root procfs path alias. This technique resolves to the filesystem
root through procfs and can bypass path-based denylists or security controls that match on canonical paths like
/usr/bin/. An AI coding agent (Claude Code) was observed using this technique autonomously to evade its own permission
denylist without any adversarial prompting. This is also a general defense evasion technique usable by any process.
"""
id = "5b95dcac-7e0a-4f3c-ab4b-a94cf84d793e"
license = "Elastic License v2"
name = "Suspicious Binary Execution via Path Alias"
os_list = ["linux"]
reference = [
    "https://awesomeagents.ai/news/claude-code-sandbox-escape-denylist/",
    "https://man7.org/linux/man-pages/man5/proc.5.html",
]
version = "1.0.6"

query = '''
process where event.type == "start" and event.action == "exec" and
(
  process.executable like "/proc/*/root/*" or
  process.args regex """/proc/(self|[0-9]{1,7})/root/[a-z].*"""
) and
not (
  process.args like ("/proc/*/root/etc/*", "/proc/1/root/var/lib/rancher/*", "/proc/1/root/var/lib/cni/*", "cat", "readlink", "ls") or
  process.executable == "./opt/spire/bin/spire-server" or
  process.parent.command_line == "runc init" or
  (process.executable == "/usr/bin/slirp4netns" and process.parent.executable == "/usr/bin/rootlesskit") or
  (
    process.parent.command_line == "/usr/bin/perl /usr/bin/pve8to9 --full" and
    process.executable == "/usr/bin/x86_64-linux-gnu-objdump"
  )
)
'''

min_endpoint_version = "7.15.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0

[[actions]]
action = "kill_process"
field = "process.parent.entity_id"
state = 0

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1036"
name = "Masquerading"
reference = "https://attack.mitre.org/techniques/T1036/"
[[threat.technique.subtechnique]]
id = "T1036.005"
name = "Match Legitimate Resource Name or Location"
reference = "https://attack.mitre.org/techniques/T1036/005/"



[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"

[internal]
min_endpoint_version = "7.15.0"

Detection rules belong to the projects that publish them and remain under their own licenses. This site indexes and links to them; it claims no rights in them.