Details
PoC
Tested against Gitea main checkout:
6a270662690439cabe8582e92c22b04d1f8a3fe9
Verified affected versions tested locally:
main 6a27066269 reproduced dynamically
v1.26.1 afdbd9b7c5 reproduced dynamically
v1.25.5 f913d90ab6 reproduced dynamically
v1.24.7 99053ce4fa reproduced dynamically
v1.23.8 cccd54999a reproduced dynamically
v1.22.6 8eefa1f6de reproduced dynamically with Go 1.22.12 test toolchain
v1.21.11 V4 artifactsv4.go route not present in routers/api/actions; not affected by this V4 signed URL path as tested
Unless otherwise noted, the affected code snippets and line numbers above refer to the tested main checkout 6a27066269. Older release branches contain the same vulnerable signed URL construction and post-verification context confusion, but line numbers and artifact lookup details differ slightly between releases. For example, newer code includes run_attempt_id in the artifact lookup, while older V4 implementations look up by run/name/path/content-encoding. These differences do not affect the demonstrated HMAC boundary-collision primitive.
For main, v1.26.1, and v1.25.5, the PoC uses the private user2/repo2 fixture and demonstrates cross-repository artifact read. For v1.24.7, v1.23.8, and v1.22.6, the compatible test fixtures differ, so the portable PoC demonstrates the same signed URL rewrite across task/run contexts; v1.22.6 creates the target artifact inside the test because that release does not include the newer artifact fixture file.
The private-repository disclosure impact is demonstrated on releases with suitable private repository fixtures; on older fixtures, the portable test confirms the same cross-context signed URL rewrite primitive, which applies to private targets under the same running-task and known-identifier conditions. The PoC was adapted per release only to account for fixture and test-toolchain differences; the exploit primitive is the same signed URL tuple rewrite.
Local test environment:
- Gitea integration test environment.
- Default local Actions artifact storage, not Azure direct upload.
- Existing fixture tasks/artifacts from Gitea's test fixtures.
- The dynamic PoC sets the target task status to
runningbefore exploiting the URL, matching the vulnerable signed URL requirement.
Run:
cd /home/kali/gitea/pocs
GITEA_REPO=/home/kali/gitea/repo GOTOOLCHAIN=auto go run ./actions_artifact_v4_cross_task_access_dynamic_poc.go
The dynamic PoC writes a temporary integration test into the Gitea checkout, runs only that test, and removes the temporary test afterward.
The test uses:
attacker task: 48
attacker run: 792
attacker job: 193
attacker repository id: 4
target task: 53
target run: 795
target job: 198
target repository: user2/repo2, repository id 2
target artifact: artifact-795-1
crafted attacker artifact: artifact-795-153
PoC flow:
- Create an Actions authorization token for attacker task
48. - Verify the attacker token cannot request a signed URL for target run
795through the authenticated Twirp API. - Create an attacker-controlled V4 artifact named
artifact-795-153. - Upload and finalize that attacker artifact to obtain a legitimate signed URL.
- Rewrite the signed download URL:
artifactName=artifact-795-1
taskID=53
artifactID=48<attackerArtifactID>
- Send the forged final
GETwithout any token and receive the private target artifact fromuser2/repo2. - Rewrite the signed upload URL in the same way.
- Send a forged
PUT ...&comp=appendBlockwith attacker-controlled data. - Confirm the target artifact metadata was changed by the forged upload.
- Open the target run/artifact staging chunk from storage and confirm it contains the attacker-controlled bytes.
Observed output:
source=/home/kali/gitea/repo
ok code.gitea.io/gitea/tests/integration 9.069s
reproduced: attacker task cannot request a target-run signed URL through the authenticated Twirp method
reproduced: attacker-created V4 signed URL keeps its HMAC after taskID/artifactName/artifactID rewrite
reproduced: unauthenticated final GET returns the URL-selected target artifact instead of attacker content
reproduced: forged UploadArtifact URL writes attacker-controlled bytes into target run/artifact staging storage and changes target artifact metadata
condition=attacker can run a Gitea Actions task and target task/artifact identifiers are known while target task is running
cvss_candidate=CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:N
Example version test commands:
cd /home/kali/gitea/pocs
GITEA_REPO=/home/kali/gitea/version-tests/gitea-v1.26.1 go run ./actions_artifact_v4_cross_task_access_dynamic_poc.go
GITEA_REPO=/home/kali/gitea/version-tests/gitea-v1.25.5 go run ./actions_artifact_v4_cross_task_access_dynamic_poc.go
GITEA_REPO=/home/kali/gitea/version-tests/gitea-v1.24.7 go run ./actions_artifact_v4_cross_task_access_dynamic_poc.go
GITEA_REPO=/home/kali/gitea/version-tests/gitea-v1.23.8 go run ./actions_artifact_v4_cross_task_access_dynamic_poc.go
GITEA_REPO=/home/kali/gitea/version-tests/gitea-v1.22.6 GITEA_TEST_GOTOOLCHAIN=go1.22.12 go run ./actions_artifact_v4_cross_task_access_dynamic_poc.go
Some release worktrees require a local gitea binary before integration tests run:
cd /path/to/gitea-release-worktree
go build -tags 'sqlite sqlite_unlock_notify' -o gitea .
Impact
This is a cross-task and cross-repository authorization bypass in Gitea Actions artifact handling.
An attacker who can run an Actions job can obtain a valid V4 artifact signed URL for their own task, rewrite it without invalidating the HMAC, and make the server operate in another running task's context.
Impacted users are Gitea instances with Actions enabled and V4 artifact signed URL handling in use. Private repositories are impacted because the forged signed URL handlers do not re-check repository access after reconstructing task context from URL parameters.
Confirmed impact:
- Confidentiality: read artifacts from a target running task in a private repository.
- Integrity: write attacker-controlled artifact data into the target run/artifact staging storage and mutate target artifact metadata.
This can expose build outputs, logs or packaged artifacts stored as workflow artifacts, and can interfere with in-flight artifact upload staging. Depending on the target upload/finalization flow, it may poison artifact data consumed by later workflow steps, release automation, deployment jobs, or downstream users.
Recommended fix:
- Sign a canonical structured payload, such as JSON/protobuf or length-prefixed fields, instead of concatenating raw values. A versioned payload is preferable, for example
HMAC(version || canonical_payload). - Include and enforce endpoint, expiry, task ID, artifact ID, artifact name, run ID, run attempt ID, repository ID, and owner ID in the signed payload.
- After signature verification, load the artifact by signed
artifactID. - Reject the request unless the signed artifact ID, task ID, run ID, run attempt ID, repository ID, owner ID, and artifact name all match.
- Apply artifact-name validation to V4 artifact creation as hardening.