fix(security): extend /proc read block to smaps, smaps_rollup, numa_maps, mem - #32238
Closed
AhmetArif0 wants to merge 1 commit into
Closed
fix(security): extend /proc read block to smaps, smaps_rollup, numa_maps, mem#32238AhmetArif0 wants to merge 1 commit into
AhmetArif0 wants to merge 1 commit into
Conversation
…aps, mem PR NousResearch#4609 blocked /proc/*/maps to prevent ASLR layout leakage, but the endswith("/maps") check does not match /proc/*/smaps or /proc/*/smaps_rollup — both expose the same virtual-address layout and bypass the guard. /proc/*/numa_maps carries the same data with NUMA annotations and is equally bypassed. /proc/*/mem (raw process memory) is added as defence-in-depth; it requires address knowledge to exploit but is blocked for consistency. Extends the endswith tuple in _is_blocked_device_path() to cover all four variants and adds regression assertions for all new paths to test_proc_sensitive_pseudo_files_blocked. Partially addresses NousResearch#4427.
teknium1
added a commit
that referenced
this pull request
May 29, 2026
Follow-up to the cherry-pick of @AhmetArif0's #32238. auxv is the glaring miss alongside maps/smaps — it exposes AT_RANDOM (stack canary) and AT_BASE/AT_PHDR (program/interpreter load addresses), which is a direct ASLR oracle on par with /proc/*/maps. pagemap exposes virtual→physical address translations on systems that expose it to userspace (depends on CAP_SYS_ADMIN / kernel config) — same address-leak class. Adds both to the same endswith tuple and to the existing parametrized test, keeping the fragile-suffix pattern consistent with the rest of the guard. A regex/set refactor across all /proc leak vectors (pagemap, syscall, stack, wchan, kallsyms) is worth a follow-up but out of scope for closing this immediate gap.
teknium1
added a commit
that referenced
this pull request
Jul 1, 2026
auxv leaks AT_RANDOM (stack canary seed) + AT_BASE/AT_PHDR load addresses — an ASLR oracle on par with maps. pagemap exposes virtual->physical translation. Both slipped through the endswith tuple alongside the maps family covered by the salvaged commit. Adds regression coverage for auxv/pagemap and for the per-thread /proc/<pid>/task/<tid>/<file> alias form (endswith catches both). Follow-up on #32238, closes #34430.
Contributor
waefrebeorn
pushed a commit
to waefrebeorn/slermes
that referenced
this pull request
Jul 2, 2026
auxv leaks AT_RANDOM (stack canary seed) + AT_BASE/AT_PHDR load addresses — an ASLR oracle on par with maps. pagemap exposes virtual->physical translation. Both slipped through the endswith tuple alongside the maps family covered by the salvaged commit. Adds regression coverage for auxv/pagemap and for the per-thread /proc/<pid>/task/<tid>/<file> alias form (endswith catches both). Follow-up on NousResearch#32238, closes NousResearch#34430.
Jasper6439
pushed a commit
to Jasper6439/hermes-agent
that referenced
this pull request
Jul 5, 2026
auxv leaks AT_RANDOM (stack canary seed) + AT_BASE/AT_PHDR load addresses — an ASLR oracle on par with maps. pagemap exposes virtual->physical translation. Both slipped through the endswith tuple alongside the maps family covered by the salvaged commit. Adds regression coverage for auxv/pagemap and for the per-thread /proc/<pid>/task/<tid>/<file> alias form (endswith catches both). Follow-up on NousResearch#32238, closes NousResearch#34430.
habarmc1223-sudo
pushed a commit
to habarmc1223-sudo/hermes-agent-fluxmem
that referenced
this pull request
Jul 8, 2026
auxv leaks AT_RANDOM (stack canary seed) + AT_BASE/AT_PHDR load addresses — an ASLR oracle on par with maps. pagemap exposes virtual->physical translation. Both slipped through the endswith tuple alongside the maps family covered by the salvaged commit. Adds regression coverage for auxv/pagemap and for the per-thread /proc/<pid>/task/<tid>/<file> alias form (endswith catches both). Follow-up on NousResearch#32238, closes NousResearch#34430.
santhreal
pushed a commit
to santhreal/hermes-agent
that referenced
this pull request
Jul 13, 2026
auxv leaks AT_RANDOM (stack canary seed) + AT_BASE/AT_PHDR load addresses — an ASLR oracle on par with maps. pagemap exposes virtual->physical translation. Both slipped through the endswith tuple alongside the maps family covered by the salvaged commit. Adds regression coverage for auxv/pagemap and for the per-thread /proc/<pid>/task/<tid>/<file> alias form (endswith catches both). Follow-up on NousResearch#32238, closes NousResearch#34430.
Gravezzz
pushed a commit
to Gravezzz/hermes-agent
that referenced
this pull request
Jul 21, 2026
auxv leaks AT_RANDOM (stack canary seed) + AT_BASE/AT_PHDR load addresses — an ASLR oracle on par with maps. pagemap exposes virtual->physical translation. Both slipped through the endswith tuple alongside the maps family covered by the salvaged commit. Adds regression coverage for auxv/pagemap and for the per-thread /proc/<pid>/task/<tid>/<file> alias form (endswith catches both). Follow-up on NousResearch#32238, closes NousResearch#34430.
leewenjie
pushed a commit
to leewenjie/hermes-agent
that referenced
this pull request
Aug 7, 2026
auxv leaks AT_RANDOM (stack canary seed) + AT_BASE/AT_PHDR load addresses — an ASLR oracle on par with maps. pagemap exposes virtual->physical translation. Both slipped through the endswith tuple alongside the maps family covered by the salvaged commit. Adds regression coverage for auxv/pagemap and for the per-thread /proc/<pid>/task/<tid>/<file> alias form (endswith catches both). Follow-up on NousResearch#32238, closes NousResearch#34430.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PR #4609 blocked
read_fileaccess to/proc/*/mapsto prevent ASLRlayout leakage, but the
endswith("/maps")check does not catch threeclosely-related paths that expose the same information:
/proc/*/smapsmaps)/proc/*/smaps_rollup/proc/*/numa_maps/proc/*/memRoot cause
"/proc/self/smaps".endswith("/maps")→False. An agent could callread_file("/proc/self/smaps")and recover all virtual-address rangesthat the
mapsblock was intended to prevent.Fix
Extend the
endswithtuple to cover all four variants. No behaviourchange for the already-blocked paths;
cpuinfo,meminfo,uptime,versionremain accessible.Test plan
test_proc_sensitive_pseudo_files_blockedextended with 8 newassertions covering
smaps,smaps_rollup,numa_maps, andmemfor both
/proc/self/and/proc/<pid>/formstest_proc_legitimate_files_not_blockedunchanged — top-level/procfiles stay accessibletests/tools/test_file_read_guards.py)ruff checkcleanPartially addresses #4427.