Repository navigation
🏗️🔧:keep the sync's write token from installed code #1923
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
openinf-commit-queue
merged 1 commit into
live
from
claude/full-audit-0e491i-sync-token
Oct 20, 2026
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔒 Security & Privacy | 🟠 Major | 🏗️ Heavy lift
The
checkjob still exposes the app private key to the install step.The split keeps the write token out of the install job. It does not keep the app private key out of that job.
checkjob referencessecrets.SDK_SYNC_APP_IDandsecrets.SDK_SYNC_APP_PRIVATE_KEYin itsread-tokenstep (lines 71-72). The runner sends every secret that a job references toRunner.Workerwhen the job starts. The secret then stays in that process's memory for the whole job.sudo. A lifecycle script that runs duringpnpm installcan therefore dumpRunner.Workermemory. The 2025tj-actions/changed-filescompromise used this method to extract job secrets. Secret masking only affects log output, so it does not prevent this.contents: writeandpull-requests: writeonopeninf.github.io, or any other permission the app has. Thepermission-actions: readinput only narrows the token that this workflow requests. It does not narrow what the key can do.Fix: Do not reference app secrets in any job that installs dependencies.
fetchjob that does not install anything. It mints the read-only SDK token, runsgh run download, and uploads the result withactions/upload-artifact.checkgets the files withactions/download-artifact, which uses this run'sGITHUB_TOKENand needs no app secret. It then unpacks, installs, and runsnps compile.importSdkApiDocs.pull-requestusesneeds: [fetch, check]and downloads the artifact thatfetchuploaded. Those bytes never passed through an install, so the reason given in the comment at lines 135-139 still holds. This job then unpacks, mints the write token, and opens the pull request.With this layout, the app private key is only referenced in jobs that run no third-party code. In
check,GITHUB_TOKENshould be limited tocontents: readandactions: read.Sketch of the job layout
Pin both artifact actions to a full commit SHA, like the other actions in this workflow.
fetchuploads the artifact, sofetchcan no longer drop symbolic links or files without anyone noticing.upload-artifactdoes not keep symlinks or file modes. The unpack task already refuses symbolic links, so this is acceptable. Confirm that the SDK artifact does not depend on file modes.This finding follows the retrieved learnings: "isolate privileged token usage into a separate job that never executes untrusted code", and pass a shared artifact between jobs with upload-artifact/download-artifact when they preserve what is needed.
🤖 Prompt for AI Agents
Source: Learnings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. The job that installs still names the app's private key, so a lifecycle script could read it from the runner and mint a write token itself. The fix is a
fetchjob that installs nothing: it holds the key, downloads the artifact and uploads it to this run. Thencheckreads that upload withGITHUB_TOKEN(contents: read,actions: read) and names no app secret.pull-requestkeeps re-downloading from the SDK, because that job installs nothing, and so it still enforces the unpack task's symlink refusal on the SDK's own bytes.Leaving this thread open until the maintainer approves the workflow change.
Generated by Claude Code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DerekNonGeneric Thanks for the clarification. Keeping the direct SDK download in
pull-requestpreserves the unpack task’s symlink check against the SDK’s original artifact. That job does not need to consume thefetchupload.The proposed layout addresses the private-key exposure. This finding remains open pending maintainer approval and implementation.
✏️ Learnings added
You are interacting with an AI system.