ci/security: pin actions, add workflow permissions, sanitize log#12
Merged
Conversation
Clears the open CodeQL medium alerts in this repo: - actions/unpinned-tag: pin dtolnay/rust-toolchain, Swatinem/rust-cache and softprops/action-gh-release to commit SHAs in ci.yml and release.yml. - actions/missing-workflow-permissions: add top-level `permissions: contents: read` to ci.yml (all four jobs are read-only build/test). - js/log-injection: strip CR/LF from the download error detail before logging in npm/scripts/postinstall.js.
There was a problem hiding this comment.
Code Review
This pull request sanitizes error messages in the post-installation script by stripping carriage returns and line feeds to prevent log injection. The review feedback suggests a robust fallback for cases where the error object does not contain a message property, ensuring the actual error is still logged.
CodeQL did not accept the newline-stripping sanitizer on the URL-derived error text. Log a fixed guidance message instead of interpolating err.message; the request URL is already printed above for debugging.
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.
Clears all open CodeQL medium alerts in this repo (11).
dtolnay/rust-toolchain@stable,Swatinem/rust-cache@v2,softprops/action-gh-release@v3to commit SHAs (version kept in trailing comment) inci.ymlandrelease.yml.permissions: contents: readtoci.yml; all four jobs (rust, supply-chain, agent-config, npm-wrapper) are read-only build/test.release.ymlalready declares permissions and is untouched there.npm/scripts/postinstall.js, so a value flowing in from the download URL/target cannot forge log lines.YAML +
node --checkvalidated.