Skip to content

Python memory_scraping: "/proc/" + str(pid) fires for any /proc/<pid>/ file (cmdline, status), not only mem #9460

Backlog

Description

@squid-protocol

Found by the SOP-002 gap-cell decoy suite (protocol SOP-002-v1, epic #8863).

Construct: the python memory_scraping arm ['"]/proc/['"]\s*\+\s*(?:str\([^)]*\)|f?['"]\{[^}]*\}) fires on the "/proc/" + str(pid) prefix alone, whatever file of /proc/<pid>/ is opened next. The contract (signal_contracts.py) is "a read of another process's memory image"; reading a process's command line or status is not.

Snippets and actual hits (expected 0 each):

  • p = "/proc/" + str(pid) + "/cmdline" -> 1
  • p = "/proc/" + str(pid) + "/status" -> 1

The positive control mem = open("/proc/" + str(pid) + "/mem", "rb") fires as it should, and open("/proc/meminfo") correctly reads 0.

Two related observations on the same rule, not locked as tests: the f-string form open(f"/proc/{pid}/mem") reads 0 (recall miss of the most common modern spelling), and /proc/self/mem (the program's own memory, not another process's) reads 1.

Rule: gitgalaxy/standards/language_standards/languages/python.py, memory_scraping.

Locked in tests/decoys/test_decoy_python.py as xfail(strict=True).

Activity

  1. added
    bug
    on Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions