Detection rules › Elastic

Suspicious Binary Execution via Path Alias

Source
github.com/elastic/protections-artifacts

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.

MITRE ATT&CK coverage

Rule body

[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.5"

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")
)
'''

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"

Stages and Predicates

Stage 1: process

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")
)

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.executableeq/usr/bin/slirp4netnsexcludes:process.executable field:"process.executable" value:"/usr/bin/slirp4netns"
process.parent.executableeq/usr/bin/rootlesskitexcludes:process.parent.executable field:"process.parent.executable" value:"/usr/bin/rootlesskit"
process.argswildcard/proc/*/root/etc/*, /proc/1/root/var/lib/rancher/*, /proc/1/root/var/lib/cni/*, cat, readlink, lsexcludes:process.args
process.executableeq./opt/spire/bin/spire-serverexcludes:process.executable field:"process.executable" value:"./opt/spire/bin/spire-server"
process.parent.command_lineeqrunc initexcludes:process.parent.command_line field:"process.parent.command_line" value:"runc init"

Indicators

These rows show field, operator, and value matches.