Skip to content

ci/security: pin actions, add workflow permissions, sanitize log#12

Merged
avifenesh merged 2 commits into
mainfrom
fix/codescan-mediums
May 30, 2026
Merged

ci/security: pin actions, add workflow permissions, sanitize log#12
avifenesh merged 2 commits into
mainfrom
fix/codescan-mediums

Conversation

@avifenesh
Copy link
Copy Markdown
Collaborator

Clears all open CodeQL medium alerts in this repo (11).

  • actions/unpinned-tag - pin dtolnay/rust-toolchain@stable, Swatinem/rust-cache@v2, softprops/action-gh-release@v3 to commit SHAs (version kept in trailing comment) in ci.yml and release.yml.
  • actions/missing-workflow-permissions - add top-level permissions: contents: read to ci.yml; all four jobs (rust, supply-chain, agent-config, npm-wrapper) are read-only build/test. release.yml already declares permissions and is untouched there.
  • js/log-injection - strip CR/LF from the download error detail before logging in npm/scripts/postinstall.js, so a value flowing in from the download URL/target cannot forge log lines.

YAML + node --check validated.

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.
Copilot AI review requested due to automatic review settings May 30, 2026 09:45
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

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.

Comment thread npm/scripts/postinstall.js Outdated
Comment thread npm/scripts/postinstall.js Fixed
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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.
@avifenesh avifenesh merged commit a963426 into main May 30, 2026
8 checks passed
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.

3 participants