Repository navigation
am-i-hacked: venv integrity, dark-corner system scan, --max-findings, and review fixes - #12
Merged
Merged
Conversation
…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.
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.
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.
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.
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.
am-i-hacked: Python virtualenv integrity, dark-corner system scan,
--max-findings, and the fixes a security review of this branch turned up.Added
RECORDhashes (HIGH),RECORDpaths 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),RECORDentries with no hash, venvs whoseRECORDfiles were deleted, and code-running.pthandsitecustomizehooks.--systemalso 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.psorcodesignmissing, acrontab -lerror, an AI-tool configjqcannot parse, an unreadable dark corner, your own relative-path processlsofcould not resolve.Changed
bin/host-audit.shis nowbin/system-scan.sh;host-audit.shstays as a shim.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
main). Source files are now always read as text.|in aRECORDconsole-script name could mark any plantedbin/script as claimed.RECORDpath through a symlinked folder made the scanner read and hash a file outside the venv.RECORDin a venv made it scan clean.python*,pip*), sopython3-helperorpipxwere skipped. It is now exact names, and an unclaimedpipis reported..venvas a HIGH "outside the package" finding.Execlines were glob-expanded; hook commands were cut at a tab; persistence scripts with a newline in the name were not read.--max-findings 08hit bash octal parsing;0and unbounded values were accepted.Every fix has a bats test, and each new test fails against the previous commit.
Docs
docs/llms.txtmark the dark-corner scan, venv integrity and--max-findingsas the next release, so the published 2.0.1 is not misrepresented.secure-semgrep'sssrfloadout added to its README and docs.npxrun command per tool card, a plain line under the hero command, absolute canonical URL,SoftwareApplicationJSON-LD with its author, and an author credit in the footer.llms.txt, the landing page and the skills saynpx am-i-hacked(no trailing.; it scans the current folder) andnpm install --save-dev.Merge
Squash merge, please: the branch has an empty commit and several fix-up commits.