Skip to content

fix(actions): reject hard-linked workflow and pin manifest inputs - #408

Merged
drevendev merged 4 commits into
masterfrom
beautifulrepo/action-pins-hardlink-20261118
Nov 18, 2026
Merged

drevendev merged 4 commits into
masterfrom
beautifulrepo/action-pins-hardlink-20261118

Conversation

@drevendev

Copy link
Copy Markdown
Owner

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

  • Require single-linked regular files before reading the workflow or manifest, and re-check file identity and link count on the opened descriptor.
  • Use O_NOFOLLOW where available and O_NONBLOCK to avoid a substituted FIFO blocking the checker.
  • Add two subprocess-driven regressions with hard-link aliases from a separate temporary directory; assert exit 2, an explicit rejection and unchanged external bytes.
  • Update tool documentation and the public Unreleased security changelog. Stable-checkout assumptions remain; not a race-free filesystem sandbox.

Evidence and limitations

No settings, policies, license, release/tag, private controls or external repository altered.

@drevendev drevendev left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@drevendev
drevendev merged commit 01b69a3 into master Nov 18, 2026
8 checks passed
@drevendev
drevendev deleted the beautifulrepo/action-pins-hardlink-20261118 branch November 18, 2026 04:18
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.

1 participant