{
  "id": 21151679,
  "title": "My shell-injection scanner flagged 3 of my own files. All 3 were wrong.",
  "url": "https://urgent.news/2026/11/22/my-shell-injection-scanner-flagged-3-of-my-own-files-all-3-were-wrong",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-11-22T01:44:11.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/aurum_revenue/my-shell-injection-scanner-flagged-3-of-my-own-files-all-3-were-wrong-13ho"
  },
  "original_language": "en",
  "account": "A shell-injection scanner flagged three files within its own source tree, all of which were incorrectly marked as vulnerable. The author developed a small static checker called sg audit to identify three specific call shapes that convert untrusted text into shell syntax. After running sg audit on the source tree, it found 90 Python files with 6 findings, and 3 of those findings were real. The three real findings were in different files within a demo service, and they were indeed genuine. Two of the findings were caused by using subprocess.run([BT] + args) and subprocess.run([\"version\", \"-V\"]), while the third was due to a named helper function named \"run\" within the same file that was also imported from subprocess. The author emphasizes that while a scanner that constantly flags false positives can be annoying, it is crucial that it does not overlook real vulnerabilities. The author provides two potential fixes to address the false positives: inspecting the left operand of a binary operation to determine if it is a list or string literal, and resolving the name of bare function calls through the file's imports. These changes would help differentiate between correct and incorrect usage of subprocess.run, allowing the scanner to be more reliable while still catching actual vulnerabilities.",
  "summary": "My shell-injection scanner flagged 3 of my own files. All 3 were wrong. I built a small static checker called sg audit . It finds the three call shapes that turn untrusted text into shell syntax: shell=True , os.system / os.popen , and a subprocess call whose first argument is a string instead of an argv list. Tonight I pointed it at our own source tree. 90 Python files, 6 findings, exit 1. Three…",
  "key_points": [
    "Scanner flagged three files as vulnerable in its own source tree",
    "Three flagged findings were actual vulnerabilities",
    "Author suggests fixes to reduce false positives"
  ],
  "editors_take": "The tendency for static checkers to misidentify legitimate subprocess calls as vulnerabilities highlights the ongoing difficulty of distinguishing between safe syntax and genuine shell-injection risks in automated security auditing.",
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}