Skip to content

fix(releases): validate artifact manifest JSON shape - #129432

Draft
joshuarli wants to merge 2 commits into
masterfrom
fix/releasefile-manifest-shape
Draft

joshuarli wants to merge 2 commits into
masterfrom
fix/releasefile-manifest-shape

Conversation

@joshuarli

Copy link
Copy Markdown
Member

Behavioral split from #129431.

The release archive manifest and artifact index are user-uploaded JSON. The typing pass cast json.loads() to dict[str, object] without checking the decoded shape. Validate that the result is an object at the boundary, in _read_manifest, _ArtifactIndexGuard.readable_data, and writable_data.

A malformed manifest now raises ValueError with a clear message instead of failing later with AttributeError or TypeError.

Test: test_manifest_must_be_a_json_object.

The release archive manifest and artifact index are user-uploaded JSON.
Validate that the decoded value is an object before treating it as one,
so malformed input fails at the boundary instead of raising
AttributeError deeper in the archive reader.
joshuarli added a commit to joshuarli/sentry that referenced this pull request Oct 31, 2026
The release archive manifest and artifact index are user-uploaded JSON.
Validate that the decoded value is an object before treating it as one,
so malformed input fails at the boundary instead of raising
AttributeError deeper in the archive reader.

Review split: getsentry#129432.
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Oct 31, 2026
The manifest root is validated, but `files` still needs an object shape
before it is counted and indexed. Reject non-object values at the
archive boundary and cover both malformed shapes.
joshuarli added a commit to joshuarli/sentry that referenced this pull request Oct 31, 2026
The manifest root is validated, but `files` still needs an object shape
before it is counted and indexed. Reject non-object values at the archive
boundary and cover both malformed shapes.

Review split: getsentry#129432.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant