Repository navigation
fix(actions): reject hard-linked workflow and pin manifest inputs - #408
Conversation
drevendev
left a comment
There was a problem hiding this comment.
Later-run acceptance review of exact head 653a272cc1535f24d05c2071a5cd0855192f0c9a (same-account COMMENT, not independent APPROVED): inspected all four file patches and full tools/action_pins.py and tests/test_action_pins.py; the lstat -> os.open -> fstat checks require a single-linked regular file and matching device/inode before bounded UTF-8 parsing. Both outside-directory hard-link tests assert exit 2, explicit rejection and unchanged external content. Quality CI run 44230414211 now has six successful jobs (including Python 3.11/3.14 and Windows), and MCP smoke run 44230414212 has two successful jobs. No material finding in this bounded change. Limitation: stable-checkout preflight, not race-free filesystem isolation; no local full-suite run because checkout DNS is unavailable. Ready for expected-head integration only if fresh provider mergeability and required checks remain satisfied.
Reader-facing defect
The offline Actions pin checker used
Path.lstat()to reject symlinks but accepted hard links to workflow files and.github/action-pins.json. A hard link appears as a regular file even when its other name is outside the selected repository. The checker then read and parsed that aliased source, unlike BeautifulRepo's other hardened offline scanners.Change
O_NOFOLLOWwhere available andO_NONBLOCKto avoid a substituted FIFO blocking the checker.Evidence and limitations
b5baa4e25dfe9458adbf91f03ea08ff5c09ab83e; branch diff is four public files, +59/-5, no catalog change.lstat()reports an outside hard link as regular (link count 2). Ran a standalone synthetic smoke of the proposed reader on Linux: ordinary file accepted, hard link and symlink rejected, size bound preserved. This is not the BeautifulRepo test suite.os.fstat/os.lstatandstat.S_ISREGdocs on 2026-11-18: https://docs.python.org/3/library/os.html and https://docs.python.org/3/library/stat.html.python -m unittest discover -s tests -v,python -I tools/action_pins.py --root .andpython tools/docs_links.pynot run locally: GitHub checkout DNS is unavailable. Require fresh exact-head CI and a distinct later-run review before integration.No settings, policies, license, release/tag, private controls or external repository altered.