Repository navigation
fix: fence untrusted log output, cap numeric inputs, pin actions to SHAs - #7
Merged
Merged
Conversation
…ob summary, cap inputs, pin actions
- Log agent/API text inside a stop-commands block so it cannot inject
runner workflow commands (add-mask, error, ...).
- HTML-escape everything in the job summary and only link https URLs.
- Cap timeout_minutes (360) and poll_interval_seconds (3600) so a large
value cannot overflow setTimeout into a tight poll loop.
- Compare realpath(argv[1]) too, so a symlinked action dir still runs main().
- Mask the trimmed API key as well as the raw input.
- README/example: pass step outputs through env, not ${{ }} in run:;
drop the unused pull-requests: write.
- Pin third-party actions to commit SHAs; timeout-minutes on every job.
- release.yml: skip pre-releases; refuse to move the major tag to a
commit that is not on main.
- Mock API uses a reserved .invalid host instead of a real hostname.
- Add dependabot.yml (actions weekly, npm security-only) and ignore .env.
Contributor
Author
|
This pull request was created from a Blocks session. |
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
AlejandroEsquivel
marked this pull request as ready for review
September 16, 2026 08:39
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.
What
::as a workflow command. The agent'sfinal_messageand the API-supplied session URL were written withcore.infoverbatim, so an agent reply containing::add-mask::eor::error::...could mask characters in later logs or spoof annotations. Both now go through alogUntrustedhelper that wraps them in a::stop-commands::<random-uuid>block.timeout_minutes≤ 360 (GitHub's job limit) andpoll_interval_seconds≤ 3600. A value above 2^31-1 ms is clamped to 1 ms by Node'ssetTimeout, which turned the poll loop into a tight loop against the API.argv[1]is not resolved, so a symlinked action directory skippedmain()and exited 0 with no outputs. Both forms are now compared.Workflows
actions/checkoutv5.1.0,actions/setup-nodev5.0.0,github/codeql-actionv4.38.0).timeout-minuteson every job.release.ymlskips pre-releases and refuses to move the floating major tag to a commit that is not an ancestor ofmain.Docs and examples
final_message/pull_requestsstraight intorun:via${{ }}, which SECURITY.md advises against. Both now pass outputs throughenv:.pull-requests: writepermission. The action never usesGITHUB_TOKEN.action.ymldocument the new input maxima.Other
scripts/mock-api.mjsusedhttps://api.prod.blocks.teamas its fake foreign host. That is a real, resolvable hostname and showed up in every CI log. Replaced withhttps://api.example.invalid..gitignoreignores.envand.env.*.Repo settings changed alongside this PR
v*.*: no update, force-push, or deletion) and Protect floating major tags (v1,v2, …: no deletion; updates stay allowed because the release workflow moves them withGITHUB_TOKEN). Admins bypass both.codeql.ymlis the intended configuration (excludesdist/, pinned versions, required check in the ruleset), and its first live run on this PR passed.Testing
npm run lint,npm run type-check: clean.npm run test: 66 tests (4 new: input caps,logUntrusted).actionlint1.7.12 + shellcheck: clean on all three workflows.dist/index.mjsand ran it end-to-end against the mock: stop-commands fencing visible in the log, outputs unchanged.main()and fails on the missing agent as expected, instead of exiting 0 silently.Follow-ups (settings, not in this PR)
🤖 Generated with Claude Code