Skip to content

am-i-hacked: venv integrity, dark-corner system scan, --max-findings, and review fixes - #12

Merged
IsaacBell merged 11 commits into
mainfrom
feat/dark-corners-venv-integrity
Oct 7, 2026
Merged

IsaacBell merged 11 commits into
mainfrom
feat/dark-corners-venv-integrity

Conversation

@IsaacBell

@IsaacBell IsaacBell commented Oct 7, 2026 •

Copy link
Copy Markdown
Owner

am-i-hacked: Python virtualenv integrity, dark-corner system scan, --max-findings, and the fixes a security review of this branch turned up.

Added

  • Python virtualenv integrity check in the folder scan, for every venv under the scanned folder: files that no longer match their RECORD hashes (HIGH), RECORD paths that leave the venv or pass through a symlinked folder (HIGH, never opened), files and symlinks no package owns, console scripts no package claims (each venv on its own claims), RECORD entries with no hash, venvs whose RECORD files were deleted, and code-running .pth and sitecustomize hooks.
  • --system also scans a fixed list of places where tooling installs code outside any project (venvs, uv/pip/npx caches, pyenv, pipx, pnpm, cargo, bun, deno, go, gem). Absent folders are skipped; unreadable ones are reported.
  • --max-findings N (1 to 999999999, default 1000); the true total and per-rule counts print past the cap.
  • The system scan reports a check it could not run instead of passing it: ps or codesign missing, a crontab -l error, an AI-tool config jq cannot parse, an unreadable dark corner, your own relative-path process lsof could not resolve.

Changed

  • bin/host-audit.sh is now bin/system-scan.sh; host-audit.sh stays as a shim.
  • Hex and unicode escape findings in installed dependency folders (site-packages, dist-packages, node_modules) are one summary line. vendor/ is committed code, so its findings are still listed.

Security fixes found in review

  • A source file with one NUL byte was skipped as binary, hiding the whole file from the folder scan (also on main). Source files are now always read as text.
  • A | in a RECORD console-script name could mark any planted bin/ script as claimed.
  • A console-script claim in one venv hid a planted script of the same name in another.
  • A RECORD path through a symlinked folder made the scanner read and hash a file outside the venv.
  • Deleting every RECORD in a venv made it scan clean.
  • Bin allowlist was a prefix match (python*, pip*), so python3-helper or pipx were skipped. It is now exact names, and an unclaimed pip is reported.
  • Scanning a repo root reported every console script in its .venv as a HIGH "outside the package" finding.
  • systemd/autostart Exec lines were glob-expanded; hook commands were cut at a tab; persistence scripts with a newline in the name were not read.
  • --max-findings 08 hit bash octal parsing; 0 and unbounded values were accepted.

Every fix has a bats test, and each new test fails against the previous commit.

Docs

  • Root README, package README and docs/llms.txt mark the dark-corner scan, venv integrity and --max-findings as the next release, so the published 2.0.1 is not misrepresented.
  • secure-semgrep's ssrf loadout added to its README and docs.
  • Landing page: npx run command per tool card, a plain line under the hero command, absolute canonical URL, SoftwareApplication JSON-LD with its author, and an author credit in the footer.
  • Every README, llms.txt, the landing page and the skills say npx am-i-hacked (no trailing .; it scans the current folder) and npm install --save-dev.

Merge

Squash merge, please: the branch has an empty commit and several fix-up commits.

…thon venv integrity check, --max-findings (default 1000), faster scans

- bin/host-audit.sh is now bin/system-scan.sh; host-audit.sh stays as a shim.
- --system also scans a fixed list of places where tooling installs code outside any project (venvs, uv/pip/npx caches, cargo, bun, deno, go, gem bins). Absent folders are skipped silently.
- New venv integrity check: files that no longer match their package RECORD hashes, RECORD paths leaving the venv, unowned files, code-running .pth and sitecustomize hooks. Unreadable files and folders, symlinks and newline names are reported, never skipped.
- --max-findings N, default raised from 100 to 1000; total and per-rule counts printed past the cap.
- Hex and unicode escape findings in dependency folders are one summary line. Null-byte warnings on binary files are gone.
- README cut from 368 to 139 lines; docs landing page covers the whole toolset.
@IsaacBell IsaacBell changed the title am-i-hacked: system scan renamed system-scan.sh with dark corners, Py… am-i-hacked: Python venv checks, system scan improvements Oct 7, 2026
Comment thread apps/am-i-hacked/bin/venv-integrity.sh Outdated
IsaacBell and others added 6 commits October 6, 2026 23:10
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
- secure-semgrep run path: pnpx secure-semgrep ./src (was 'From this repository')
- status lists am-i-hacked 2.0.1, am-i-being-recorded 1.0.0, secure-semgrep 1.0.1
- mark am-i-hacked dark-corner/virtualenv/--max-findings as next release
- add the ssrf loadout to the secure-semgrep README and docs
- landing page cards carry run commands; footer credits Ike Web Studio
- author and studio links in the README and llms.txt
Folder scan: read source files as text, so one NUL byte no longer hides a
file; stop listing vendor/ hex hits as dependency noise; validate
--max-findings (1 to 999999999, no leading zero).

Venv integrity: key console-script claims by path per venv; reject | in a
claimed name; never open a RECORD path through a symlinked folder; report
unclaimed symlinks, entries with no hash, bin symlinks, a non-stock
_virtualenv.pth, and venvs whose RECORDs or dist-info folders were deleted;
exact-name bin allowlist; allow console scripts of a venv nested in the
scanned folder.

System scan: report checks it could not run (ps, crontab, codesign, lsof,
jq parse errors, unreadable corners, own unreadable payload files) instead
of passing; split hook rows on the unit separator; NUL-delimit payload
paths; no glob expansion of Exec lines; skip empty Exec lines.

Each fix has a bats test that fails against the previous commit.
Run commands say npx with no trailing dot (the folder scan defaults to the
current folder), install lines say npm install --save-dev, and the CI
snippets drop the pnpm setup step. Landing page: plain line under the hero
command, absolute canonical URL, SoftwareApplication JSON-LD with its
author, and a footer credit linking the author's site.
@IsaacBell IsaacBell changed the title am-i-hacked: Python venv checks, system scan improvements am-i-hacked: venv integrity, dark-corner system scan, --max-findings, and review fixes Oct 7, 2026
Comment thread apps/am-i-hacked/bin/system-scan.sh Fixed
Comment thread apps/am-i-hacked/bin/system-scan.sh Fixed
Comment thread docs/index.html Fixed
Reword two crontab strings in system-scan.sh that matched the
persistence-install rule as prose, and mark the absolute canonical link in
docs/index.html as reviewed: it names the page and is never fetched, so
subresource integrity does not apply.
Comment thread docs/index.html Fixed
Semgrep's missing-integrity rule flags an absolute https link tag and does
not honour an inline HTML nosemgrep comment. The relative form main already
used resolves to the same URL and does not trigger it.
Rewrite the lede and two tool cards as full sentences: no dash-wrapped
asides, no stacked fragments, and plain words in place of jargon.
@IsaacBell
IsaacBell merged commit 1c4806e into main Oct 7, 2026
15 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants