sillsdev / sillsdev/interlinearizer-extension

Publish job persists a write credential where core's unpinned scripts can read it

Open
#341 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug github_actions up next
Dominant language
TypeScript
Stars
2
Forks
0
Avg merge
1d 17h
Merged PRs (30d)
55

Description

Summary

The publish job checks out this repo with credentials persisted, then runs two npm scripts from an unpinned external branch in the same runner. Those scripts can read the checkout's http.extraheader and reuse the job's contents: write token against this repository.

Detail

.github/workflows/publish.yml checks out extension-repo without persist-credentials: false, so extension-repo/.git/config carries an AUTHORIZATION: basic <base64 x-access-token:GITHUB_TOKEN> header. The job grants contents: write.

The same job then checks out paranext/paranext-core with no ref, resolving to whatever its default branch HEAD is at run time, and executes two core-owned scripts before the release is created:

  • npm run stage-dev-packages
  • npm run verify:dev-packages

npm ci --ignore-scripts does not cover these — they are explicit invocations, added deliberately because the install skips lifecycle scripts.

A malicious or compromised core revision could read the sibling checkout's git config, extract the header, and push to this repository.

Why this workflow specifically

Every other workflow already sets persist-credentials: false on its own checkout — test.yml, lint.yml, codeql.yml. publish.yml is the only one that does not, and the only one with contents: write. This is a gap in an otherwise consistent pattern, not a missing convention.

Mitigating factors

  • workflow_dispatch only, so a maintainer has to trigger it.
  • The unpinned core ref is deliberate and documented in-workflow; this issue is about the credential, not the floating ref. Pinning core for release builds only would make release builds diverge from what CI validated.

The two halves are coupled

persist-credentials: false alone breaks the version bump. lib/bump-versions.ts runs git push -u origin HEAD, which authenticates through exactly the header being removed. So the fix has to be:

  1. persist-credentials: false on both extension-repo checkouts in publish.yml — the second one matters too, since clean: false reuses the directory and would otherwise re-persist the credential.
  2. bump-versions-action takes a token input and configures the credential itself, scoped to that one step.

Neither half ships alone.

Upstream consideration

.github/actions/bump-versions-action/action.yml is currently byte-identical to paranext-extension-template. publish.yml has already diverged substantially and is effectively repo-owned, but the action has not.

That means the vulnerability is template-wide — any extension repo built on this template has the same publish-job shape — and a local-only fix to the action creates a conflict surface on every future template merge. Worth deciding whether the action half belongs upstream before patching it here.

Verification already done

A prototype of the above was built and reverted (it was noticed on merge-template, which should stay a clean template merge). Confirmed during that work:

  • Restore-on-exit logic tested under bash: token live during the run; header removed where none pre-existed, restored to the persisted value where one did, and restored on failure.
  • ncipollo/release-action defaults token to ${{ github.token }} and authenticates via the API, not the checkout — the release step is unaffected by dropping persisted credentials.
  • .github/workflows/bump-versions.yml is a second caller of the action; it checks out no external repo so has no exposure, but it would need the new input passed.
  • npm run lint passed; all YAML parsed.

Nothing was run in CI.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read .github/workflows/publish.yml, .github/actions/bump-versions-action/action.yml, lib/bump-versions.ts, and .github/workflows/bump-versions.yml. Check how both publish checkouts and the action handle credentials, then run the mentioned lint and YAML checks. Done means the publish workflow no longer exposes persisted credentials while version bumping still authenticates through the scoped action input, with the second caller updated as needed.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, github-actions, typescript
Domain
ci-cd, release, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.