Skip to content

image lifecycle: the test CDN serves only what its indexes list - #15

Merged
aledbf merged 1 commit into
mainfrom
fix/cdn-allowlist
Oct 14, 2026
Merged

aledbf merged 1 commit into
mainfrom
fix/cdn-allowlist

Conversation

@aledbf

@aledbf aledbf commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator

Closes CodeQL alert #1 (go/path-injection, cmd/image/lifecycle.go).

The fake update CDN test:lifecycle runs took a release file's name from the request and joined it to a path on disk, behind a regex and a slot check. CodeQL cannot see a regex as a sanitiser, and a well-formed name no release published was served when it matched the pattern.

Each index's lines now make the map of what exists, name to path, at construction; a request only looks a name up. Anything the indexes do not list is 404: a version no release has, a file in another release's slot, a release directory's other files, a path out of the slot. TestUpdateCDN covers the four.

task check passes.

🤖 Generated with Claude Code

The fake update CDN took a release file's name from the request and joined it to a path on disk,
behind a regex and a slot check. CodeQL (go/path-injection) cannot see a regex as a sanitiser,
and a name a release did not publish was served when it matched the pattern. Each index's lines
now make the map of what exists, name to path, at construction; a request only looks a name up,
and anything the indexes do not list, a path out of the slot included, is 404.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@aledbf
aledbf merged commit 9bd7db1 into main Oct 14, 2026
5 checks passed
@aledbf
aledbf deleted the fix/cdn-allowlist branch October 14, 2026 19:54
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.

1 participant