Skip to content

DOCOPS-160 Harden docs-deploy-surge.yml against artifact poisoning (sync from docs-template) - #171

Merged
recrwplay merged 2 commits into
devfrom
security/deploy-surge-artifact-poisoning
Jul 21, 2026
Merged

DOCOPS-160 Harden docs-deploy-surge.yml against artifact poisoning (sync from docs-template)#171
recrwplay merged 2 commits into
devfrom
security/deploy-surge-artifact-poisoning

Conversation

@recrwplay

Copy link
Copy Markdown
Contributor

What

Syncs .github/workflows/docs-deploy-surge.yml with the canonical version in neo4j/docs-template to resolve the critical CodeQL Artifact poisoning alert (#1) on dev.

Why

docs-deploy-surge.yml runs on workflow_run (completion of Verify docs PR) and downloads/handles artifacts built from PR content, which can originate from an untrusted fork. The template version adds hardening that the copy in this repo was missing:

  • validate-changelog step — rejects a symlinked changelog file before its contents are read into the PR comment, preventing arbitrary-file-read from a poisoned artifact.
  • process.env.RUN_ID instead of ${{ env.RUN_ID }} in the github-script step — avoids GitHub Actions expression injection into the inline JS.
  • Comment/whitespace tidy-ups to match the template.

This matches the same fix already merged and marked fixed in the public neo4j/docs-tools repo.

Not changed

  • No branch or path filters were modified.
  • The optional approve-fork environment gate is left commented out, matching the template. docs-tools enables it, but doing so requires first creating a preview environment (with required reviewers) in this repo's settings — worth considering as a follow-up for defence-in-depth, but out of scope here to avoid breaking deploys.

Verification

Reconciled against neo4j/docs-template@main; the resulting file is byte-identical to the template. Re-scan on dev after merge should clear alert #1.

🤖 Generated with Claude Code

…cs-template)

Syncs .github/workflows/docs-deploy-surge.yml with the canonical version in
neo4j/docs-template to resolve the critical CodeQL "artifact poisoning" alert:

- add a validate-changelog step that rejects a symlinked changelog before it is
  read into the PR comment (prevents arbitrary-file-read from a poisoned artifact)
- use process.env.RUN_ID instead of ${{ env.RUN_ID }} in the github-script step
  (avoids GitHub Actions expression injection)
- comment/whitespace tidy-ups to match the template

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@recrwplay recrwplay changed the title Harden docs-deploy-surge.yml against artifact poisoning (sync from docs-template) DOCOPS-158 Harden docs-deploy-surge.yml against artifact poisoning (sync from docs-template) Jul 20, 2026
…emplate)

Refreshes the sync to the now-canonical docs-template version (docs-template#59):
replaces the old `unzip -l | grep '../'` suspicious-path-check with the zipinfo
loop that also rejects empty archives, absolute paths, and Windows-style
backslash separators. No branch/path filters changed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@recrwplay recrwplay changed the title DOCOPS-158 Harden docs-deploy-surge.yml against artifact poisoning (sync from docs-template) DOCOPS-160 Harden docs-deploy-surge.yml against artifact poisoning (sync from docs-template) Jul 20, 2026
@neo4j-docops-agent

neo4j-docops-agent commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the documentation updates.

The preview documentation has now been torn down - reopening this PR will republish it.

@recrwplay
recrwplay marked this pull request as ready for review July 20, 2026 15:37
@recrwplay
recrwplay merged commit 5e66f06 into dev Jul 21, 2026
5 checks passed
@recrwplay
recrwplay deleted the security/deploy-surge-artifact-poisoning branch July 21, 2026 11:23
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.

2 participants