Common Weakness Enumeration

CWE-285

Discouraged

Improper Authorization

Abstraction: Class · Status: Draft

The product does not perform or incorrectly performs an authorization check when an actor attempts to access a resource or perform an action.

2343 vulnerabilities reference this CWE, most recent first.

GHSA-772M-43F3-HMF8

Vulnerability from github – Published: 2024-06-07 17:15 – Updated: 2024-06-07 17:15
VLAI
Summary
TYPO3 Broken Access Control in Localization Handling
Details

It has been discovered that backend users having limited access to specific languages are capable of modifying and creating pages in the default language which actually should be disallowed. A valid backend user account is needed in order to exploit this vulnerability.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "Packagist",
        "name": "typo3/cms"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "8.0.0"
            },
            {
              "fixed": "8.7.23"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [],
  "database_specific": {
    "cwe_ids": [
      "CWE-285"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2024-06-07T17:15:33Z",
    "nvd_published_at": null,
    "severity": "MODERATE"
  },
  "details": "It has been discovered that backend users having limited access to specific languages are capable of modifying and creating pages in the default language which actually should be disallowed. A valid backend user account is needed in order to exploit this vulnerability.",
  "id": "GHSA-772m-43f3-hmf8",
  "modified": "2024-06-07T17:15:33Z",
  "published": "2024-06-07T17:15:33Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/TYPO3/typo3/commit/5004201ee77a69cb825637bc95cdeedb1186f4d4"
    },
    {
      "type": "WEB",
      "url": "https://github.com/FriendsOfPHP/security-advisories/blob/master/typo3/cms/2019-01-22-3.yaml"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/TYPO3/typo3"
    },
    {
      "type": "WEB",
      "url": "https://typo3.org/security/advisory/typo3-core-sa-2019-003"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N",
      "type": "CVSS_V3"
    }
  ],
  "summary": "TYPO3 Broken Access Control in Localization Handling"
}

GHSA-774Q-WFCP-VC2Q

Vulnerability from github – Published: 2022-05-24 17:11 – Updated: 2024-04-23 23:37
VLAI
Summary
Moodle Email media URL tokens were not checking for user status
Details

A vulnerability was found in Moodle 3.6 before 3.6.7 and 3.7 before 3.7.3, where tokens used to fetch inline atachments in email notifications were not disabled when a user's account was no longer active. Note: to access files, a user would need to know the file path, and their token.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "Packagist",
        "name": "moodle/moodle"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "3.6"
            },
            {
              "fixed": "3.6.7"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    },
    {
      "package": {
        "ecosystem": "Packagist",
        "name": "moodle/moodle"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "3.7"
            },
            {
              "fixed": "3.7.3"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2019-14883"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-285",
      "CWE-862"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2024-04-23T23:37:43Z",
    "nvd_published_at": "2020-03-18T13:15:00Z",
    "severity": "MODERATE"
  },
  "details": "A vulnerability was found in Moodle 3.6 before 3.6.7 and 3.7 before 3.7.3, where tokens used to fetch inline atachments in email notifications were not disabled when a user\u0027s account was no longer active. Note: to access files, a user would need to know the file path, and their token.",
  "id": "GHSA-774q-wfcp-vc2q",
  "modified": "2024-04-23T23:37:43Z",
  "published": "2022-05-24T17:11:48Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2019-14883"
    },
    {
      "type": "WEB",
      "url": "https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2019-14883"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/moodle/moodle"
    },
    {
      "type": "WEB",
      "url": "https://moodle.org/mod/forum/discuss.php?d=393586#p1586750"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N",
      "type": "CVSS_V3"
    }
  ],
  "summary": "Moodle Email media URL tokens were not checking for user status"
}

GHSA-777R-4V59-6486

Vulnerability from github – Published: 2026-07-21 20:35 – Updated: 2026-07-21 20:35
VLAI
Summary
Gitea: Permanent Fork PR Workflow Approval Gate Bypass
Details
Field Value
Identifier (researcher-assigned) GITEA-2026-004
Product Gitea (self-hosted Git service)
Component Gitea Actions — fork pull request approval gate
Affected versions All Gitea releases v1.20.0 and later, including the latest main (1.27.0+dev-289-gb7e95cc48c). The buggy logic was introduced in commit edf98a2dc3"Require approval to run actions for fork pull request (#22803)", 2023-02-24 — and has shipped unchanged since.
Fixed in not yet (this disclosure)
Authentication required Yes — one unprivileged Gitea account capable of forking the target repository (the default ability for every authenticated user)
User interaction required Exactly once — a repository administrator must approve a single benign fork PR's workflow run from the attacker. After that, no further interaction is ever required for any future fork PR from the same attacker on the same repository.
Discovered by Prakhar Porwal — prakharporwal2004@gmail.com
Live-verified on Gitea main at commit b7e95cc48cc0e0d6fe24c89bb83da5b84a74490f, 2026-05-24

1. Executive summary

Gitea Actions enforces an approval gate on workflow runs triggered by fork pull requests, so that an untrusted contributor cannot execute arbitrary workflow YAML on the maintainer's runner infrastructure without explicit consent. The gate is implemented by ifNeedApproval() in services/actions/notifier_helper.go. Its final clause skips the gate whenever the triggering user has any previously-approved run in the same repository:

// services/actions/notifier_helper.go:423-433
if count, err := db.Count[actions_model.ActionRun](ctx, actions_model.FindRunOptions{
    RepoID:        repo.ID,
    TriggerUserID: user.ID,
    Approved:      true,
}); err != nil {
    return false, fmt.Errorf("CountRuns: %w", err)
} else if count > 0 {
    log.Trace("do not need approval because user %d has been approved before", user.ID)
    return false, nil
}

The check is scoped to (repo_id, trigger_user_id) only. It does not consider the pull request, the head commit, the workflow file contents, or any time window. The single approval click on a contributor's first fork PR is therefore interpreted by Gitea as "this user is permanently trusted to execute any workflow YAML on this repository's CI infrastructure forever" — for every future PR, on any branch, against any commit, regardless of what the workflow does.

This is a structural deviation from the documented intent — the in-source comment on the bypassing path reads "if it's the first time user … triggered actions", implying a per-action-trigger check that the code does not actually perform. It is also a deviation from the equivalent behavior on the platform Gitea Actions is modeled after (GitHub Actions), where the first-contributor gate persists until a PR is merged, not merely approved-to-run.

I have live-reproduced the bypass end-to-end against a current main build. With zero further interaction from the maintainer after the one-time approval, an attacker's second PR's workflow:

  • Was created with need_approval = 0 and approved_by = 0 in the action_run table (i.e. nobody ever approved it, and yet it was not gated).
  • Was dispatched to the runner immediately.
  • Executed arbitrary shell on the runner, with outbound network access, a populated GITHUB_TOKEN, and access to the cloned source.

Full receipts are in §3.


2. Affected code

Primary

services/actions/notifier_helper.go:401-438 — the ifNeedApproval function:

func ifNeedApproval(ctx context.Context, run *actions_model.ActionRun,
                    repo *repo_model.Repository, user *user_model.User) (bool, error) {
    // 1. don't need approval if it's not a fork PR
    // 2. don't need approval if the event is `pull_request_target` since the
    //    workflow will run in the context of base branch
    if !run.IsForkPullRequest ||
       run.TriggerEvent == actions_module.GithubEventPullRequestTarget {
        return false, nil
    }

    // always need approval if the user is restricted
    if user.IsRestricted {
        return true, nil
    }

    // don't need approval if the user can write
    if perm, err := access_model.GetDoerRepoPermission(ctx, repo, user); err != nil {
        return false, fmt.Errorf("GetDoerRepoPermission: %w", err)
    } else if perm.CanWrite(unit_model.TypeActions) {
        return false, nil
    }

    // ===== VULNERABLE BLOCK ==================================================
    // don't need approval if the user has been approved before
    if count, err := db.Count[actions_model.ActionRun](ctx, actions_model.FindRunOptions{
        RepoID:        repo.ID,
        TriggerUserID: user.ID,
        Approved:      true,
    }); err != nil {
        return false, fmt.Errorf("CountRuns: %w", err)
    } else if count > 0 {
        return false, nil   // <-- permanent, unscoped bypass
    }
    // =========================================================================

    return true, nil
}

Called from handleWorkflows() (services/actions/notifier_helper.go:339) for every workflow run created in response to a fork PR; the return value populates the NeedApproval column on the action_run row.

Supporting

  • models/actions/run_list.go:84-86 — the FindRunOptions.Approved filter resolves to approved_by > 0: go if opts.Approved { cond = cond.And(builder.Gt{"`action_run`.approved_by": 0}) }
  • services/actions/approve.go:25-27 — the only writer of ApprovedBy, called when a repo admin clicks Approve on a run: go run.NeedApproval = false run.ApprovedBy = doer.ID if err := actions_model.UpdateRun(ctx, run, "need_approval", "approved_by"); err != nil {
  • models/actions/run.go:44-45 — schema: go NeedApproval bool // may need approval if it's a fork pull request ApprovedBy int64 `xorm:"index"` // who approved

There is no other writer of ApprovedBy, and no resetter for NeedApproval once a PR has been approved. The historical row is permanent and unconditional.


3. Live reproduction — receipts

The following was performed end-to-end against main on the date noted. Two accounts were used:

  • admin (uid 1) — repository owner playing the maintainer
  • admin2 (uid 3) — second account playing the attacker

A fork-mode gitea-runner v1.0.6 was registered with ubuntu-latest:host to enable on-host execution.

Phase Action Resulting action_run row
1 admin creates admin/base-repo with .gitea/workflows/ci.yml (echo hello baseline)
2 admin2 forks the repo
3 admin2 opens PR #1 with a one-line README edit (no workflow change) run #5 created, need_approval = 1, status = Blocked
4 admin clicks Approve and run workflows on PR #1 run #5 updates: need_approval = 0, approved_by = 1 (admin), status → Success
5 admin2 opens PR #3 from a brand-new branch (bypass-clean) whose only change is .gitea/workflows/ci.yml rewritten to a malicious payload (loud echo + curl + id + ls -la) run #6 created, need_approval = 0, approved_by = 0 — gate skipped at creation
runner dispatches run #6 within seconds, no maintainer interaction at all run #6 → status = Success

Final action_run table contents (queried directly from SQLite)

id  triggered_by_uid  need_approval  approved_by_uid  status_text  ref               sha
--  ----------------  -------------  ---------------  -----------  ----------------  --------
5   3                 0              1                Success      refs/pull/1/head  463c9114
6   3                 0              0                Success      refs/pull/3/head  70db2b9e

Row 6 is the smoking gun: triggered_by is admin2 (the attacker), approved_by is 0 (no one ever clicked Approve), need_approval is 0 (the gate was never engaged in the first place), and the workflow ran to completion. The row is schema-indistinguishable from a legitimate trusted-user run.

Actual payload log from run #6 (verbatim from /api/v1/repos/admin/base-repo/actions/jobs/6/logs)

2026-05-23T21:38:53Z local-demo-runner(version:v1.0.6) received task 2 of job test, be triggered by event: pull_request
2026-05-23T21:38:53Z workflow prepared
2026-05-23T21:38:53Z Run Main pwn
...
2026-05-23T21:38:53Z env:
2026-05-23T21:38:53Z   BASE_TOKEN: ***
2026-05-23T21:38:53Z ===== BYPASS DEMO - this workflow ran WITHOUT approval =====
2026-05-23T21:38:53Z running as: uid=501(prakharporwal) gid=20(staff) groups=20(staff),12(everyone),...
2026-05-23T21:38:53Z hostname:   PRAKHARs-MacBook-Air.local
2026-05-23T21:38:53Z uname:      Darwin PRAKHARs-MacBook-Air.local 25.5.0 Darwin Kernel Version 25.5.0...
2026-05-23T21:38:53Z GITHUB_TOKEN length = 40
2026-05-23T21:38:53Z outbound network test:
2026-05-23T21:38:53Z   HTTP 200
2026-05-23T21:38:53Z repo contents:
2026-05-23T21:38:53Z total 0
2026-05-23T21:38:53Z drwxr-xr-x  2 prakharporwal  staff   64 24 May 03:08 .
2026-05-23T21:38:53Z drwxr-xr-x  5 prakharporwal  staff  160 24 May 03:08 ..
2026-05-23T21:38:53Z ===== END DEMO =====
2026-05-23T21:38:53Z Job succeeded

Confirmed: arbitrary shell execution on the runner, populated GITHUB_TOKEN (40 chars), live outbound HTTPS (HTTP 200 to example.com), all triggered by an unapproved second fork PR.


4. Root cause analysis

The logic embodies a misreading of the unit of trust.

Intended (per comment on line 436) Actually implemented
Approval is required the first time a user triggers actions. Approval is required the very first time a user triggers actions and never again.
The unit of trust is the work being approved (the PR, or the commit). The unit of trust is the user's identity, scoped to the repository.

The query at line 424 does not include PullRequestID, Ref, CommitSHA, or any time predicate. The action_run row's Ref and CommitSHA fields are not consulted. Once approved_by > 0 appears on any historical row for (repo_id, trigger_user_id), the gate is monotonically skipped forever.

Concretely, the divergence is observable across these scenarios:

Scenario Intended Implemented
Same PR, new commit on the same branch Re-run uses existing approval (PR-scoped) Auto-approved (user-scoped) ✓
Same PR, force-push that replaces the workflow file Re-approval requested Auto-approved ✗
Brand-new PR from same user, different workflow Approval requested Auto-approved ✗ — the vulnerability
New PR from same user months later Approval requested Auto-approved ✗
Hundred PRs from same user in parallel Only the first is the gate check; subsequent depend on policy Only the very first ever needs approval ✗

For comparison, GitHub Actions' first-time-contributor gate persists until a PR is merged, not until a PR is approved-to-run; GitHub additionally supports per-PR re-approval as a separate setting. The Gitea code path does neither.

A secondary contributor is the coarse semantics of FindRunOptions.Approved: a single boolean (approved_by > 0) with no per-PR/per-commit predicate available. The fix therefore needs both a call-site change and a query-options extension.


5. Impact

Dimension Detail
Arbitrary code execution on the runner Attacker controls run: blocks dispatched to the project's CI compute, with whatever ambient privileges the runner has (shell, network, filesystem). Verified end-to-end above.
Source code disclosure The runner clones the base repository read-only. A malicious workflow can exfiltrate it via any outbound channel — material confidentiality breach if the repo is private.
Actions cache poisoning Actions cache entries are keyed and shared across branches/refs within a repo. A poisoned cache is restored into trusted (non-fork) runs that subsequently execute on the base branch — escaping the fork sandbox transitively, and at that point with full secret access.
Artifact poisoning Workflow artifacts can be downloaded by other runs, including base-branch deploy workflows.
Runner host compromise If the runner is long-lived (not ephemeral) or shares state across jobs (filesystem leftovers, mounted Docker socket, sudoers entry for the runner user), the attacker can plant persistence.
Network pivoting Many self-hosted runners live inside corporate networks with reach to internal services that would otherwise be unreachable from the public internet.
Resource abuse Cryptomining, denial-of-service of the CI infrastructure, bandwidth abuse.
No audit signal The bypassed run row has approved_by = 0 and need_approval = falseschema-indistinguishable from a legitimate trusted-user run. There is no log line, no webhook event, no UI banner stating that the approval gate was skipped (only that it wasn't needed).
Scope Every repository that accepts fork pull requests and has Actions enabled. Public OSS projects are most exposed because anyone can open a PR. Internal corporate repos that accept fork PRs from contractors / interns / outside collaborators are equally exposed once a single such PR has been approved historically.
Defense-in-depth bypass The approval gate is the only line of defense between untrusted PR YAML and CI execution on regular pull_request events. Remaining mitigations — per-fork-PR GITEA_TOKEN scoping (models/actions/token_permissions.go:54-57) and secret omission (models/secret/secret.go:160-165) — reduce blast radius but do not prevent code execution.

6. Manual reproduction (web UI only, ~10 minutes)

This procedure uses only the Gitea web interface — no curl, no git CLI, no API tokens. It is intended for the maintainer security team to verify the vulnerability on a fresh instance.

Prerequisites

  1. A Gitea instance with Actions enabled ([actions] ENABLED = true in app.ini).
  2. One Actions runner registered and online with the ubuntu-latest label (optional — see note at the end of this section).
  3. Two user accounts:
  4. maintainer — will own the target repository.
  5. attacker — any unprivileged second account; registered through normal sign-up; no special privileges required.
  6. Two browser sessions: a normal window for maintainer, and a private/incognito window for attacker. Do not flip between them in the same window.

Phase 1 — maintainer creates the target repository

  1. Log into Gitea as maintainer.
  2. Top-right +New Repository.
  3. Owner = maintainer, Name = gate-bypass-poc, Visibility = Public, ☑ Initialize Repository, Default Branch = main. Click Create Repository.
  4. On the repo home, click the + icon in the file tree → New File.
  5. In the path field type: .gitea/workflows/ci.yml
  6. Paste the following into the editor — name: must be at column 0 with no leading whitespace: yaml name: CI on: [pull_request] jobs: test: runs-on: [ubuntu-latest] steps: - name: hello run: echo "hello from gate-bypass-poc baseline"
  7. Scroll down → Commit directly to mainCommit Changes.

Phase 2 — attacker forks the repository

  1. Switch to the attacker window. Log in.
  2. Navigate to …/maintainer/gate-bypass-poc.
  3. Click Fork (top-right). Accept defaults (owner = attacker). Click Fork Repository.

Phase 3 — attacker opens a benign PR (PR #1)

  1. On …/attacker/gate-bypass-poc, click README.md → pencil icon to edit.
  2. Add any innocuous line (e.g. Small typo fix.).
  3. Scroll down → select Create a new branch for this commit and start a pull request → branch name benign-typo. Click Propose File Change.
  4. On the pre-filled "Open a new pull request" form, leave defaults and click Create Pull Request.
  5. You should land on …/maintainer/gate-bypass-poc/pulls/1.

Phase 4 — maintainer approves the first run (the one-time trust event)

  1. Switch to the maintainer window. Open …/maintainer/gate-bypass-poc/pulls/1.
  2. Scroll to the status checks section. You will see the yellow banner:

    Workflow runs from fork pull requests need approval to run [ Approve and run workflows ]

  3. Before clicking, open a second tab on …/maintainer/gate-bypass-poc/actions. The workflow run "Small typo fix" should be displayed with status Blocked. This is the gate working correctly for a first-time contributor.
  4. Return to the PR tab. Click Approve and run workflows. The banner disappears; the run transitions to WaitingRunningSuccess (or stays at Waiting if no runner is online — irrelevant for the bypass demonstration).

Phase 5 — attacker opens a second PR (PR #2) with a malicious workflow change

  1. Switch back to the attacker window.
  2. On …/attacker/gate-bypass-poc, navigate to .gitea/workflows/ci.yml via the file tree. Click the pencil icon to edit.
  3. Replace the entire file with the following (name: flush left, no leading whitespace anywhere): yaml name: CI on: [pull_request] jobs: test: runs-on: [ubuntu-latest] steps: - name: pwn env: BASE_TOKEN: ${{ github.token }} run: | echo "===== BYPASS DEMO - this workflow ran WITHOUT approval =====" echo "running as: $(id 2>/dev/null || echo n/a)" echo "hostname: $(hostname 2>/dev/null || echo n/a)" echo "uname: $(uname -a 2>/dev/null || echo n/a)" echo "GITHUB_TOKEN length = ${#BASE_TOKEN}" curl -fsS --max-time 5 https://example.com/ -o /dev/null -w "egress HTTP %{http_code}\n" || echo "(no network)" ls -la echo "===== END DEMO ====="
  4. Scroll down → select Create a new branch for this commit and start a pull request → branch name bypass-payload. Click Propose File Change.
  5. On the pre-filled PR form, click Create Pull Request. You should land on …/maintainer/gate-bypass-poc/pulls/2.

Phase 6 — Observe the bypass

This is the critical observation.

  1. As maintainer, open …/maintainer/gate-bypass-poc/pulls/2. Scroll to the status checks section.
  2. Expected if the gate worked: the same yellow "Workflow runs from fork pull requests need approval to run" banner as in Phase 4.
  3. Actual: no banner. The check appears straight away as pending / running / green. No approval has been requested. maintainer was not notified.
  4. As maintainer, open …/maintainer/gate-bypass-poc/actions. The new run for "Update .gitea/workflows/ci.yml" is displayed with status Waiting / Running / Successnever Blocked.
  5. Click into the run → test job → pwn step. You will see the payload output (id, hostname, uname, token length, outbound HTTPS code, file listing) — the attacker's code executed end-to-end without your consent.

Note on the runner

If no runner is online and registered with the ubuntu-latest label, the bypass is still proven by step 1 of Phase 6 (no banner) and step 2 (status Waiting instead of Blocked). The runner only matters for visualising the payload's output. The status transition Blocked → Waiting for an unapproved second PR is itself the security signal — a gated run would remain Blocked indefinitely and the dispatcher would never look for a runner.

Note on the YAML formatting

If you copy the workflow YAML out of this document into the Gitea web editor and inadvertently keep any leading whitespace before name:, Gitea will reject the file with yaml: line 2: mapping values are not allowed in this context. No action_run row is created in that case (the workflow detector silently skips unparseable files), and the bypass will look like it didn't fire when in fact the code path was never reached. name: must sit at column 0.


7. Verifying the bypass in the database

Open a database shell on the Gitea host. The action_run table contains the smoking gun.

SQLite (default)

sqlite3 /var/lib/gitea/data/gitea.db
SELECT
  ar.id,
  ar.trigger_user_id,
  ar.need_approval,
  ar.approved_by,
  CASE ar.status
    WHEN 1 THEN 'Success' WHEN 2 THEN 'Failure' WHEN 3 THEN 'Cancelled'
    WHEN 4 THEN 'Skipped' WHEN 5 THEN 'Waiting' WHEN 6 THEN 'Running'
    WHEN 7 THEN 'Blocked' ELSE CAST(ar.status AS TEXT) END AS status,
  ar.ref
FROM action_run ar
JOIN repository r ON r.id = ar.repo_id
WHERE r.owner_name = 'maintainer' AND r.name = 'gate-bypass-poc'
ORDER BY ar.id;

Expected output after Phase 6:

id  trigger_user_id  need_approval  approved_by  status   ref
--  ---------------  -------------  -----------  -------  ----------------
N   <attacker uid>   0              <maint uid>  Success  refs/pull/1/head
N+1 <attacker uid>   0              0            Success  refs/pull/2/head

The N+1 row demonstrates the bypass: same trigger user, never approved (approved_by = 0), yet need_approval = 0 and executed successfully. This row is schema-indistinguishable from a normal trusted-user run; an audit pipeline scanning the table cannot tell the bypass apart from a legitimate write-permission user's run.

PostgreSQL / MySQL

The same query, against database_name, with \c gitea / USE gitea; first.


9. Suggested fixes

Three options, in order of preference.

Option A (recommended) — Scope approval to the commit, not the user

Extend FindRunOptions with a CommitSHA predicate (it already exists as the field at models/actions/run_list.go:70) and reframe the gate check as "has the current PR head SHA been approved by this user".

--- a/services/actions/notifier_helper.go
+++ b/services/actions/notifier_helper.go
@@
-    // don't need approval if the user has been approved before
-    if count, err := db.Count[actions_model.ActionRun](ctx, actions_model.FindRunOptions{
-        RepoID:        repo.ID,
-        TriggerUserID: user.ID,
-        Approved:      true,
-    }); err != nil {
-        return false, fmt.Errorf("CountRuns: %w", err)
-    } else if count > 0 {
-        return false, nil
-    }
+    // don't need approval if a prior run for this same PR-head commit was approved
+    if run.CommitSHA != "" {
+        if count, err := db.Count[actions_model.ActionRun](ctx, actions_model.FindRunOptions{
+            RepoID:        repo.ID,
+            TriggerUserID: user.ID,
+            CommitSHA:     run.CommitSHA,
+            Approved:      true,
+        }); err != nil {
+            return false, fmt.Errorf("CountRuns: %w", err)
+        } else if count > 0 {
+            return false, nil
+        }
+    }

This preserves the legitimate UX intent ("don't re-prompt on the same PR after a transient runner failure causes a re-run") without granting trust to future PRs or new commits on the same branch. Every new commit on the PR — including a force-push that replaces the workflow file — would re-trigger the gate, exactly as a security-sensitive deployment expects.

Option B (stricter) — Require a merged contribution, like GitHub

Replace the "approved before" branch with "has this user had a PR merged in this repo before":

if merged, err := issues_model.HasUserMergedPullRequestInRepo(ctx, repo.ID, user.ID); err != nil {
    return false, fmt.Errorf("HasUserMergedPullRequestInRepo: %w", err)
} else if merged {
    return false, nil
}

This matches the typical OSS-maintainer mental model: a contributor whose PR has been merged is trusted enough to run CI without further approval. Approving a workflow run is not merging code; the current logic conflates the two.


Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "Go",
        "name": "code.gitea.io/gitea"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "1.26.3"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2026-58424"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-285",
      "CWE-732",
      "CWE-863"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-07-21T20:35:51Z",
    "nvd_published_at": "2026-07-03T21:17:05Z",
    "severity": "HIGH"
  },
  "details": "| Field | Value |\n|-------|-------|\n| **Identifier (researcher-assigned)** | GITEA-2026-004 |\n| **Product** | Gitea (self-hosted Git service) |\n| **Component** | Gitea Actions \u2014 fork pull request approval gate |\n| **Affected versions** | All Gitea releases **`v1.20.0` and later**, including the latest `main` (`1.27.0+dev-289-gb7e95cc48c`). The buggy logic was introduced in commit `edf98a2dc3` \u2014 *\"Require approval to run actions for fork pull request (#22803)\"*, 2023-02-24 \u2014 and has shipped unchanged since. |\n| **Fixed in** | not yet (this disclosure) |\n| **Authentication required** | Yes \u2014 one unprivileged Gitea account capable of forking the target repository (the default ability for every authenticated user) |\n| **User interaction required** | Exactly **once** \u2014 a repository administrator must approve a single benign fork PR\u0027s workflow run from the attacker. After that, *no further interaction is ever required* for any future fork PR from the same attacker on the same repository. |\n| **Discovered by** | Prakhar Porwal \u2014 `prakharporwal2004@gmail.com` |\n| **Live-verified on** | Gitea `main` at commit `b7e95cc48cc0e0d6fe24c89bb83da5b84a74490f`, 2026-05-24 |\n\n---\n\n## 1. Executive summary\n\nGitea Actions enforces an approval gate on workflow runs triggered by fork pull requests, so that an untrusted contributor cannot execute arbitrary workflow YAML on the maintainer\u0027s runner infrastructure without explicit consent. The gate is implemented by `ifNeedApproval()` in `services/actions/notifier_helper.go`. Its final clause skips the gate whenever the triggering user has **any** previously-approved run in the same repository:\n\n```go\n// services/actions/notifier_helper.go:423-433\nif count, err := db.Count[actions_model.ActionRun](ctx, actions_model.FindRunOptions{\n    RepoID:        repo.ID,\n    TriggerUserID: user.ID,\n    Approved:      true,\n}); err != nil {\n    return false, fmt.Errorf(\"CountRuns: %w\", err)\n} else if count \u003e 0 {\n    log.Trace(\"do not need approval because user %d has been approved before\", user.ID)\n    return false, nil\n}\n```\n\nThe check is scoped to `(repo_id, trigger_user_id)` only. It does not consider the pull request, the head commit, the workflow file contents, or any time window. The single approval click on a contributor\u0027s *first* fork PR is therefore interpreted by Gitea as *\"this user is permanently trusted to execute any workflow YAML on this repository\u0027s CI infrastructure forever\"* \u2014 for every future PR, on any branch, against any commit, regardless of what the workflow does.\n\nThis is a structural deviation from the documented intent \u2014 the in-source comment on the bypassing path reads *\"if it\u0027s the first time user \u2026 triggered actions\"*, implying a per-action-trigger check that the code does not actually perform. It is also a deviation from the equivalent behavior on the platform Gitea Actions is modeled after (GitHub Actions), where the first-contributor gate persists until a PR is **merged**, not merely approved-to-run.\n\nI have live-reproduced the bypass end-to-end against a current `main` build. With **zero further interaction** from the maintainer after the one-time approval, an attacker\u0027s second PR\u0027s workflow:\n\n- Was created with `need_approval = 0` and `approved_by = 0` in the `action_run` table (i.e. nobody ever approved it, and yet it was not gated).\n- Was dispatched to the runner immediately.\n- Executed arbitrary shell on the runner, with outbound network access, a populated `GITHUB_TOKEN`, and access to the cloned source.\n\nFull receipts are in \u00a73.\n\n---\n\n## 2. Affected code\n\n### Primary\n\n**`services/actions/notifier_helper.go:401-438`** \u2014 the `ifNeedApproval` function:\n\n```go\nfunc ifNeedApproval(ctx context.Context, run *actions_model.ActionRun,\n                    repo *repo_model.Repository, user *user_model.User) (bool, error) {\n    // 1. don\u0027t need approval if it\u0027s not a fork PR\n    // 2. don\u0027t need approval if the event is `pull_request_target` since the\n    //    workflow will run in the context of base branch\n    if !run.IsForkPullRequest ||\n       run.TriggerEvent == actions_module.GithubEventPullRequestTarget {\n        return false, nil\n    }\n\n    // always need approval if the user is restricted\n    if user.IsRestricted {\n        return true, nil\n    }\n\n    // don\u0027t need approval if the user can write\n    if perm, err := access_model.GetDoerRepoPermission(ctx, repo, user); err != nil {\n        return false, fmt.Errorf(\"GetDoerRepoPermission: %w\", err)\n    } else if perm.CanWrite(unit_model.TypeActions) {\n        return false, nil\n    }\n\n    // ===== VULNERABLE BLOCK ==================================================\n    // don\u0027t need approval if the user has been approved before\n    if count, err := db.Count[actions_model.ActionRun](ctx, actions_model.FindRunOptions{\n        RepoID:        repo.ID,\n        TriggerUserID: user.ID,\n        Approved:      true,\n    }); err != nil {\n        return false, fmt.Errorf(\"CountRuns: %w\", err)\n    } else if count \u003e 0 {\n        return false, nil   // \u003c-- permanent, unscoped bypass\n    }\n    // =========================================================================\n\n    return true, nil\n}\n```\n\nCalled from `handleWorkflows()` (`services/actions/notifier_helper.go:339`) for every workflow run created in response to a fork PR; the return value populates the `NeedApproval` column on the `action_run` row.\n\n### Supporting\n\n- **`models/actions/run_list.go:84-86`** \u2014 the `FindRunOptions.Approved` filter resolves to `approved_by \u003e 0`:\n  ```go\n  if opts.Approved {\n      cond = cond.And(builder.Gt{\"`action_run`.approved_by\": 0})\n  }\n  ```\n- **`services/actions/approve.go:25-27`** \u2014 the only writer of `ApprovedBy`, called when a repo admin clicks Approve on a run:\n  ```go\n  run.NeedApproval = false\n  run.ApprovedBy = doer.ID\n  if err := actions_model.UpdateRun(ctx, run, \"need_approval\", \"approved_by\"); err != nil {\n  ```\n- **`models/actions/run.go:44-45`** \u2014 schema:\n  ```go\n  NeedApproval bool                // may need approval if it\u0027s a fork pull request\n  ApprovedBy   int64 `xorm:\"index\"` // who approved\n  ```\n\nThere is no other writer of `ApprovedBy`, and no resetter for `NeedApproval` once a PR has been approved. The historical row is permanent and unconditional.\n\n---\n\n## 3. Live reproduction \u2014 receipts\n\nThe following was performed end-to-end against `main` on the date noted. Two accounts were used:\n\n- `admin` (uid 1) \u2014 repository owner playing the maintainer\n- `admin2` (uid 3) \u2014 second account playing the attacker\n\nA fork-mode `gitea-runner v1.0.6` was registered with `ubuntu-latest:host` to enable on-host execution.\n\n| Phase | Action | Resulting `action_run` row |\n|-------|--------|---------------------------|\n| 1 | `admin` creates `admin/base-repo` with `.gitea/workflows/ci.yml` (`echo hello` baseline) | \u2014 |\n| 2 | `admin2` forks the repo | \u2014 |\n| 3 | `admin2` opens PR #1 with a one-line README edit (no workflow change) | run #5 created, `need_approval = 1`, status = `Blocked` |\n| 4 | `admin` clicks **Approve and run workflows** on PR #1 | run #5 updates: `need_approval = 0`, `approved_by = 1` (admin), status \u2192 `Success` |\n| 5 | `admin2` opens PR #3 from a **brand-new branch** (`bypass-clean`) whose only change is `.gitea/workflows/ci.yml` rewritten to a malicious payload (loud `echo` + `curl` + `id` + `ls -la`) | **run #6 created, `need_approval = 0`, `approved_by = 0`** \u2014 gate skipped at creation |\n| \u2014 | runner dispatches run #6 within seconds, no maintainer interaction at all | run #6 \u2192 status = `Success` |\n\n### Final `action_run` table contents (queried directly from SQLite)\n\n```\nid  triggered_by_uid  need_approval  approved_by_uid  status_text  ref               sha\n--  ----------------  -------------  ---------------  -----------  ----------------  --------\n5   3                 0              1                Success      refs/pull/1/head  463c9114\n6   3                 0              0                Success      refs/pull/3/head  70db2b9e\n```\n\nRow 6 is the smoking gun: `triggered_by` is `admin2` (the attacker), `approved_by` is **0** (no one ever clicked Approve), `need_approval` is **0** (the gate was never engaged in the first place), and the workflow ran to completion. The row is schema-indistinguishable from a legitimate trusted-user run.\n\n### Actual payload log from run #6 (verbatim from `/api/v1/repos/admin/base-repo/actions/jobs/6/logs`)\n\n```\n2026-05-23T21:38:53Z local-demo-runner(version:v1.0.6) received task 2 of job test, be triggered by event: pull_request\n2026-05-23T21:38:53Z workflow prepared\n2026-05-23T21:38:53Z Run Main pwn\n...\n2026-05-23T21:38:53Z env:\n2026-05-23T21:38:53Z   BASE_TOKEN: ***\n2026-05-23T21:38:53Z ===== BYPASS DEMO - this workflow ran WITHOUT approval =====\n2026-05-23T21:38:53Z running as: uid=501(prakharporwal) gid=20(staff) groups=20(staff),12(everyone),...\n2026-05-23T21:38:53Z hostname:   PRAKHARs-MacBook-Air.local\n2026-05-23T21:38:53Z uname:      Darwin PRAKHARs-MacBook-Air.local 25.5.0 Darwin Kernel Version 25.5.0...\n2026-05-23T21:38:53Z GITHUB_TOKEN length = 40\n2026-05-23T21:38:53Z outbound network test:\n2026-05-23T21:38:53Z   HTTP 200\n2026-05-23T21:38:53Z repo contents:\n2026-05-23T21:38:53Z total 0\n2026-05-23T21:38:53Z drwxr-xr-x  2 prakharporwal  staff   64 24 May 03:08 .\n2026-05-23T21:38:53Z drwxr-xr-x  5 prakharporwal  staff  160 24 May 03:08 ..\n2026-05-23T21:38:53Z ===== END DEMO =====\n2026-05-23T21:38:53Z Job succeeded\n```\n\nConfirmed: arbitrary shell execution on the runner, populated `GITHUB_TOKEN` (40 chars), live outbound HTTPS (HTTP 200 to example.com), all triggered by an unapproved second fork PR.\n\n---\n\n## 4. Root cause analysis\n\nThe logic embodies a misreading of the unit of trust.\n\n| Intended (per comment on line 436) | Actually implemented |\n|-----------------------------------|---------------------|\n| Approval is required *the first time* a user triggers actions. | Approval is required *the very first time* a user triggers actions and **never again**. |\n| The unit of trust is the work being approved (the PR, or the commit). | The unit of trust is the user\u0027s identity, scoped to the repository. |\n\nThe query at line 424 does not include `PullRequestID`, `Ref`, `CommitSHA`, or any time predicate. The `action_run` row\u0027s `Ref` and `CommitSHA` fields are not consulted. Once `approved_by \u003e 0` appears on any historical row for `(repo_id, trigger_user_id)`, the gate is monotonically skipped forever.\n\nConcretely, the divergence is observable across these scenarios:\n\n| Scenario | Intended | Implemented |\n|----------|----------|-------------|\n| Same PR, new commit on the same branch | Re-run uses existing approval (PR-scoped) | Auto-approved (user-scoped) \u2713 |\n| Same PR, force-push that replaces the workflow file | Re-approval requested | Auto-approved \u2717 |\n| Brand-new PR from same user, different workflow | Approval requested | **Auto-approved** \u2717 \u2014 *the vulnerability* |\n| New PR from same user months later | Approval requested | Auto-approved \u2717 |\n| Hundred PRs from same user in parallel | Only the first is the gate check; subsequent depend on policy | Only the very first ever needs approval \u2717 |\n\nFor comparison, GitHub Actions\u0027 first-time-contributor gate persists *until a PR is merged*, not until a PR is approved-to-run; GitHub additionally supports per-PR re-approval as a separate setting. The Gitea code path does neither.\n\nA secondary contributor is the coarse semantics of `FindRunOptions.Approved`: a single boolean (`approved_by \u003e 0`) with no per-PR/per-commit predicate available. The fix therefore needs both a call-site change and a query-options extension.\n\n---\n\n## 5. Impact\n\n| Dimension | Detail |\n|-----------|--------|\n| **Arbitrary code execution on the runner** | Attacker controls `run:` blocks dispatched to the project\u0027s CI compute, with whatever ambient privileges the runner has (shell, network, filesystem). Verified end-to-end above. |\n| **Source code disclosure** | The runner clones the base repository read-only. A malicious workflow can exfiltrate it via any outbound channel \u2014 material confidentiality breach if the repo is private. |\n| **Actions cache poisoning** | Actions cache entries are keyed and shared across branches/refs within a repo. A poisoned cache is restored into trusted (non-fork) runs that subsequently execute on the base branch \u2014 **escaping the fork sandbox transitively**, and at that point with full secret access. |\n| **Artifact poisoning** | Workflow artifacts can be downloaded by other runs, including base-branch deploy workflows. |\n| **Runner host compromise** | If the runner is long-lived (not ephemeral) or shares state across jobs (filesystem leftovers, mounted Docker socket, sudoers entry for the runner user), the attacker can plant persistence. |\n| **Network pivoting** | Many self-hosted runners live inside corporate networks with reach to internal services that would otherwise be unreachable from the public internet. |\n| **Resource abuse** | Cryptomining, denial-of-service of the CI infrastructure, bandwidth abuse. |\n| **No audit signal** | The bypassed run row has `approved_by = 0` and `need_approval = false` \u2014 **schema-indistinguishable** from a legitimate trusted-user run. There is no log line, no webhook event, no UI banner stating that the approval gate was *skipped* (only that it wasn\u0027t needed). |\n| **Scope** | Every repository that accepts fork pull requests **and** has Actions enabled. Public OSS projects are most exposed because anyone can open a PR. Internal corporate repos that accept fork PRs from contractors / interns / outside collaborators are equally exposed once a single such PR has been approved historically. |\n| **Defense-in-depth bypass** | The approval gate is the *only* line of defense between untrusted PR YAML and CI execution on regular `pull_request` events. Remaining mitigations \u2014 per-fork-PR `GITEA_TOKEN` scoping (`models/actions/token_permissions.go:54-57`) and secret omission (`models/secret/secret.go:160-165`) \u2014 reduce blast radius but do not prevent code execution. |\n\n---\n\n## 6. Manual reproduction (web UI only, ~10 minutes)\n\nThis procedure uses only the Gitea web interface \u2014 no `curl`, no `git` CLI, no API tokens. It is intended for the maintainer security team to verify the vulnerability on a fresh instance.\n\n### Prerequisites\n\n1. A Gitea instance with **Actions enabled** (`[actions] ENABLED = true` in `app.ini`).\n2. One Actions runner registered and online with the `ubuntu-latest` label (optional \u2014 see note at the end of this section).\n3. Two user accounts:\n   - **`maintainer`** \u2014 will own the target repository.\n   - **`attacker`** \u2014 any unprivileged second account; registered through normal sign-up; no special privileges required.\n4. Two browser sessions: a normal window for `maintainer`, and a private/incognito window for `attacker`. Do not flip between them in the same window.\n\n### Phase 1 \u2014 `maintainer` creates the target repository\n\n1. Log into Gitea as `maintainer`.\n2. Top-right `+` \u2192 **New Repository**.\n3. Owner = `maintainer`, Name = `gate-bypass-poc`, Visibility = Public, \u2611 **Initialize Repository**, Default Branch = `main`. Click **Create Repository**.\n4. On the repo home, click the **+** icon in the file tree \u2192 **New File**.\n5. In the path field type:\n   ```\n   .gitea/workflows/ci.yml\n   ```\n6. Paste the following into the editor \u2014 **`name:` must be at column 0 with no leading whitespace**:\n   ```yaml\n   name: CI\n   on: [pull_request]\n   jobs:\n     test:\n       runs-on: [ubuntu-latest]\n       steps:\n         - name: hello\n           run: echo \"hello from gate-bypass-poc baseline\"\n   ```\n7. Scroll down \u2192 **Commit directly to `main`** \u2192 **Commit Changes**.\n\n### Phase 2 \u2014 `attacker` forks the repository\n\n1. Switch to the `attacker` window. Log in.\n2. Navigate to `\u2026/maintainer/gate-bypass-poc`.\n3. Click **Fork** (top-right). Accept defaults (owner = `attacker`). Click **Fork Repository**.\n\n### Phase 3 \u2014 `attacker` opens a benign PR (PR #1)\n\n1. On `\u2026/attacker/gate-bypass-poc`, click `README.md` \u2192 pencil icon to edit.\n2. Add any innocuous line (e.g. `Small typo fix.`).\n3. Scroll down \u2192 select **Create a new branch for this commit and start a pull request** \u2192 branch name `benign-typo`. Click **Propose File Change**.\n4. On the pre-filled \"Open a new pull request\" form, leave defaults and click **Create Pull Request**.\n5. You should land on `\u2026/maintainer/gate-bypass-poc/pulls/1`.\n\n### Phase 4 \u2014 `maintainer` approves the first run (the one-time trust event)\n\n1. Switch to the `maintainer` window. Open `\u2026/maintainer/gate-bypass-poc/pulls/1`.\n2. Scroll to the status checks section. You will see the yellow banner:\n   \u003e **Workflow runs from fork pull requests need approval to run** [ **Approve and run workflows** ]\n3. **Before clicking**, open a second tab on `\u2026/maintainer/gate-bypass-poc/actions`. The workflow run \"Small typo fix\" should be displayed with status **Blocked**. This is the gate working *correctly* for a first-time contributor.\n4. Return to the PR tab. Click **Approve and run workflows**. The banner disappears; the run transitions to **Waiting** \u2192 **Running** \u2192 **Success** (or stays at Waiting if no runner is online \u2014 irrelevant for the bypass demonstration).\n\n### Phase 5 \u2014 `attacker` opens a second PR (PR #2) with a malicious workflow change\n\n1. Switch back to the `attacker` window.\n2. On `\u2026/attacker/gate-bypass-poc`, navigate to `.gitea/workflows/ci.yml` via the file tree. Click the pencil icon to edit.\n3. **Replace the entire file** with the following (`name:` flush left, no leading whitespace anywhere):\n   ```yaml\n   name: CI\n   on: [pull_request]\n   jobs:\n     test:\n       runs-on: [ubuntu-latest]\n       steps:\n         - name: pwn\n           env:\n             BASE_TOKEN: ${{ github.token }}\n           run: |\n             echo \"===== BYPASS DEMO - this workflow ran WITHOUT approval =====\"\n             echo \"running as: $(id 2\u003e/dev/null || echo n/a)\"\n             echo \"hostname:   $(hostname 2\u003e/dev/null || echo n/a)\"\n             echo \"uname:      $(uname -a 2\u003e/dev/null || echo n/a)\"\n             echo \"GITHUB_TOKEN length = ${#BASE_TOKEN}\"\n             curl -fsS --max-time 5 https://example.com/ -o /dev/null -w \"egress HTTP %{http_code}\\n\" || echo \"(no network)\"\n             ls -la\n             echo \"===== END DEMO =====\"\n   ```\n4. Scroll down \u2192 select **Create a new branch for this commit and start a pull request** \u2192 branch name `bypass-payload`. Click **Propose File Change**.\n5. On the pre-filled PR form, click **Create Pull Request**. You should land on `\u2026/maintainer/gate-bypass-poc/pulls/2`.\n\n### Phase 6 \u2014 Observe the bypass\n\nThis is the critical observation.\n\n1. As `maintainer`, open `\u2026/maintainer/gate-bypass-poc/pulls/2`. **Scroll to the status checks section.**\n   - **Expected if the gate worked:** the same yellow \"Workflow runs from fork pull requests need approval to run\" banner as in Phase 4.\n   - **Actual:** **no banner**. The check appears straight away as pending / running / green. No approval has been requested. `maintainer` was not notified.\n2. As `maintainer`, open `\u2026/maintainer/gate-bypass-poc/actions`. The new run for \"Update .gitea/workflows/ci.yml\" is displayed with status **Waiting** / **Running** / **Success** \u2014 **never `Blocked`**.\n3. Click into the run \u2192 `test` job \u2192 `pwn` step. You will see the payload output (`id`, hostname, uname, token length, outbound HTTPS code, file listing) \u2014 the attacker\u0027s code executed end-to-end without your consent.\n\n### Note on the runner\n\nIf no runner is online and registered with the `ubuntu-latest` label, **the bypass is still proven** by step 1 of Phase 6 (no banner) and step 2 (status `Waiting` instead of `Blocked`). The runner only matters for visualising the payload\u0027s output. The status transition `Blocked \u2192 Waiting` for an unapproved second PR is itself the security signal \u2014 a gated run would remain `Blocked` indefinitely and the dispatcher would never look for a runner.\n\n### Note on the YAML formatting\n\nIf you copy the workflow YAML out of this document into the Gitea web editor and inadvertently keep any leading whitespace before `name:`, Gitea will reject the file with `yaml: line 2: mapping values are not allowed in this context`. No `action_run` row is created in that case (the workflow detector silently skips unparseable files), and the bypass will *look* like it didn\u0027t fire when in fact the code path was never reached. **`name:` must sit at column 0.**\n\n---\n\n## 7. Verifying the bypass in the database\n\nOpen a database shell on the Gitea host. The `action_run` table contains the smoking gun.\n\n### SQLite (default)\n\n```bash\nsqlite3 /var/lib/gitea/data/gitea.db\n```\n\n```sql\nSELECT\n  ar.id,\n  ar.trigger_user_id,\n  ar.need_approval,\n  ar.approved_by,\n  CASE ar.status\n    WHEN 1 THEN \u0027Success\u0027 WHEN 2 THEN \u0027Failure\u0027 WHEN 3 THEN \u0027Cancelled\u0027\n    WHEN 4 THEN \u0027Skipped\u0027 WHEN 5 THEN \u0027Waiting\u0027 WHEN 6 THEN \u0027Running\u0027\n    WHEN 7 THEN \u0027Blocked\u0027 ELSE CAST(ar.status AS TEXT) END AS status,\n  ar.ref\nFROM action_run ar\nJOIN repository r ON r.id = ar.repo_id\nWHERE r.owner_name = \u0027maintainer\u0027 AND r.name = \u0027gate-bypass-poc\u0027\nORDER BY ar.id;\n```\n\nExpected output after Phase 6:\n\n```\nid  trigger_user_id  need_approval  approved_by  status   ref\n--  ---------------  -------------  -----------  -------  ----------------\nN   \u003cattacker uid\u003e   0              \u003cmaint uid\u003e  Success  refs/pull/1/head\nN+1 \u003cattacker uid\u003e   0              0            Success  refs/pull/2/head\n```\n\nThe N+1 row demonstrates the bypass: same trigger user, **never approved** (`approved_by = 0`), yet `need_approval = 0` and executed successfully. This row is schema-indistinguishable from a normal trusted-user run; an audit pipeline scanning the table cannot tell the bypass apart from a legitimate write-permission user\u0027s run.\n\n### PostgreSQL / MySQL\n\nThe same query, against `database_name`, with `\\c gitea` / `USE gitea;` first.\n\n---\n\n\n## 9. Suggested fixes\n\nThree options, in order of preference.\n\n### Option A (recommended) \u2014 Scope approval to the commit, not the user\n\nExtend `FindRunOptions` with a `CommitSHA` predicate (it already exists as the field at `models/actions/run_list.go:70`) and reframe the gate check as *\"has the current PR head SHA been approved by this user\"*.\n\n```diff\n--- a/services/actions/notifier_helper.go\n+++ b/services/actions/notifier_helper.go\n@@\n-    // don\u0027t need approval if the user has been approved before\n-    if count, err := db.Count[actions_model.ActionRun](ctx, actions_model.FindRunOptions{\n-        RepoID:        repo.ID,\n-        TriggerUserID: user.ID,\n-        Approved:      true,\n-    }); err != nil {\n-        return false, fmt.Errorf(\"CountRuns: %w\", err)\n-    } else if count \u003e 0 {\n-        return false, nil\n-    }\n+    // don\u0027t need approval if a prior run for this same PR-head commit was approved\n+    if run.CommitSHA != \"\" {\n+        if count, err := db.Count[actions_model.ActionRun](ctx, actions_model.FindRunOptions{\n+            RepoID:        repo.ID,\n+            TriggerUserID: user.ID,\n+            CommitSHA:     run.CommitSHA,\n+            Approved:      true,\n+        }); err != nil {\n+            return false, fmt.Errorf(\"CountRuns: %w\", err)\n+        } else if count \u003e 0 {\n+            return false, nil\n+        }\n+    }\n```\n\nThis preserves the legitimate UX intent (\"don\u0027t re-prompt on the same PR after a transient runner failure causes a re-run\") without granting trust to future PRs or new commits on the same branch. Every new commit on the PR \u2014 including a force-push that replaces the workflow file \u2014 would re-trigger the gate, exactly as a security-sensitive deployment expects.\n\n### Option B (stricter) \u2014 Require a merged contribution, like GitHub\n\nReplace the \"approved before\" branch with \"has this user had a PR merged in this repo before\":\n\n```go\nif merged, err := issues_model.HasUserMergedPullRequestInRepo(ctx, repo.ID, user.ID); err != nil {\n    return false, fmt.Errorf(\"HasUserMergedPullRequestInRepo: %w\", err)\n} else if merged {\n    return false, nil\n}\n```\n\nThis matches the typical OSS-maintainer mental model: a contributor whose PR has been *merged* is trusted enough to run CI without further approval. *Approving a workflow run is not merging code*; the current logic conflates the two.\n\n----",
  "id": "GHSA-777r-4v59-6486",
  "modified": "2026-07-21T20:35:51Z",
  "published": "2026-07-21T20:35:51Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/go-gitea/gitea/security/advisories/GHSA-777r-4v59-6486"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-58424"
    },
    {
      "type": "WEB",
      "url": "https://github.com/go-gitea/gitea/pull/38010"
    },
    {
      "type": "WEB",
      "url": "https://github.com/go-gitea/gitea/commit/699fe2ef43b9466ac1b0cb857029f91fd5b0056d"
    },
    {
      "type": "WEB",
      "url": "https://github.com/go-gitea/gitea/commit/e107498f3b6fccff35455ef17430ca68df665297"
    },
    {
      "type": "WEB",
      "url": "https://blog.gitea.com/release-of-1.26.3-and-1.26.4"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/go-gitea/gitea"
    },
    {
      "type": "WEB",
      "url": "https://github.com/go-gitea/gitea/releases/tag/v1.26.4"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:H/A:H",
      "type": "CVSS_V3"
    }
  ],
  "summary": "Gitea: Permanent Fork PR Workflow Approval Gate Bypass"
}

GHSA-77GM-M6X5-JF4F

Vulnerability from github – Published: 2026-06-09 18:30 – Updated: 2026-06-30 03:36
VLAI
Details

Improper authorization in .NET allows an authorized attacker to elevate privileges locally.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2026-45490"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-266",
      "CWE-285",
      "CWE-863"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2026-06-09T17:17:25Z",
    "severity": "HIGH"
  },
  "details": "Improper authorization in .NET allows an authorized attacker to elevate privileges locally.",
  "id": "GHSA-77gm-m6x5-jf4f",
  "modified": "2026-06-30T03:36:59Z",
  "published": "2026-06-09T18:30:50Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-45490"
    },
    {
      "type": "WEB",
      "url": "https://access.redhat.com/security/cve/CVE-2026-45490"
    },
    {
      "type": "WEB",
      "url": "https://bugzilla.redhat.com/show_bug.cgi?id=2487184"
    },
    {
      "type": "WEB",
      "url": "https://msrc.microsoft.com/update-guide/vulnerability/CVE-2026-45490"
    },
    {
      "type": "WEB",
      "url": "https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-45490.json"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-77VC-RJ32-2R33

Vulnerability from github – Published: 2024-07-10 16:04 – Updated: 2024-11-18 16:26
VLAI
Summary
OpenSearch Observability does not properly restrict access to private tenant resources
Details

Summary

An issue in the OpenSearch observability plugins allows unintended access to private tenant resources like notebooks. The system did not properly check if the user was the resource author when accessing resources in a private tenant, leading to potential data being revealed.

Impact

The lack of proper access control validation for private tenant resources in the OpenSearch observability and reporting plugins can lead to unintended data access. If an authorized user with observability or reporting roles is aware of another user's private tenant resource ID, such as a notebook, they can potentially read, modify, or take ownership of that resource, despite not being the original author, thus impacting the confidentiality and integrity of private tenant resources. The impact is confined to private tenant resources, where authorized users may gain inappropriate visibility into data intended to be private from other users within the same OpenSearch instance, potentially violating the intended separation of access. This issue does not alter the scope of access but highlights a flaw in the existing access control mechanisms.

Impacted versions <= 2.13

Patches

The patches are included in OpenSearch 2.14

Workarounds

None

References

OpenSearch 2.14 is available for download at https://opensearch.org/versions/opensearch-2-14-0.html

The latest version of OpenSearch is available for download at https://opensearch.org/downloads.html

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "Maven",
        "name": "org.opensearch.plugin:opensearch-observability"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "2.14.0.0"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2024-39901"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-285",
      "CWE-639"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2024-07-10T16:04:08Z",
    "nvd_published_at": "2024-07-09T22:15:03Z",
    "severity": "LOW"
  },
  "details": "### Summary\n\nAn issue in the OpenSearch observability plugins allows unintended access to private tenant resources like notebooks. The system did not properly check if the user was the resource author when accessing resources in a private tenant, leading to potential data being revealed.\n\n### Impact\n\nThe lack of proper access control validation for private tenant resources in the OpenSearch observability and reporting plugins can lead to unintended data access. If an authorized user with observability or reporting roles is aware of another user\u0027s private tenant resource ID, such as a notebook, they can potentially read, modify, or take ownership of that resource, despite not being the original author, thus impacting the confidentiality and integrity of private tenant resources. The impact is confined to private tenant resources, where authorized users may gain inappropriate visibility into data intended to be private from other users within the same OpenSearch instance, potentially violating the intended separation of access. This issue does not alter the scope of access but highlights a flaw in the existing access control mechanisms.\n\nImpacted versions \u003c= 2.13\n\n### Patches\n\nThe patches are included in OpenSearch 2.14\n\n### Workarounds\n\nNone\n\n### References\n\nOpenSearch 2.14 is available for download at https://opensearch.org/versions/opensearch-2-14-0.html\n\nThe latest version of OpenSearch is available for download at https://opensearch.org/downloads.html",
  "id": "GHSA-77vc-rj32-2r33",
  "modified": "2024-11-18T16:26:51Z",
  "published": "2024-07-10T16:04:08Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/opensearch-project/observability/security/advisories/GHSA-77vc-rj32-2r33"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-39901"
    },
    {
      "type": "WEB",
      "url": "https://github.com/opensearch-project/observability/commit/014423178f8f61d90442dde03cbdcd754c70a84e"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/opensearch-project/observability"
    },
    {
      "type": "WEB",
      "url": "https://opensearch.org/versions/opensearch-2-14-0.html"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:N",
      "type": "CVSS_V3"
    },
    {
      "score": "CVSS:4.0/AV:N/AC:H/AT:N/PR:L/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N",
      "type": "CVSS_V4"
    }
  ],
  "summary": "OpenSearch Observability does not properly restrict access to private tenant resources"
}

GHSA-787V-V9VQ-4RGV

Vulnerability from github – Published: 2024-12-12 15:31 – Updated: 2025-02-12 18:18
VLAI
Summary
Apache Superset: SQLLab Improper readonly query validation allows unauthorized write access
Details

Improper Authorization vulnerability in Apache Superset. On Postgres analytic databases an attacker with SQLLab access can craft a specially designed SQL DML statement that is Incorrectly identified as a read-only query, enabling its execution. Non postgres analytics database connections and postgres analytics database connections set with a readonly user (advised) are not vulnerable. 

This issue affects Apache Superset: before 4.1.0.

Users are recommended to upgrade to version 4.1.0, which fixes the issue.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "PyPI",
        "name": "apache-superset"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "4.1.0"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2024-55633"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-285",
      "CWE-863"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2024-12-12T19:23:21Z",
    "nvd_published_at": "2024-12-12T15:15:17Z",
    "severity": "HIGH"
  },
  "details": "Improper Authorization vulnerability in Apache Superset. On Postgres analytic databases an attacker with SQLLab access can\u00a0craft a specially designed SQL DML statement\u00a0that is Incorrectly identified as a read-only query, enabling its execution. Non postgres analytics database connections and postgres analytics database connections set with a readonly user (advised) are not vulnerable.\u00a0\n\nThis issue affects Apache Superset: before 4.1.0.\n\nUsers are recommended to upgrade to version 4.1.0, which fixes the issue.",
  "id": "GHSA-787v-v9vq-4rgv",
  "modified": "2025-02-12T18:18:46Z",
  "published": "2024-12-12T15:31:09Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-55633"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/apache/superset"
    },
    {
      "type": "WEB",
      "url": "https://lists.apache.org/thread/bwmd17fcvljt9q4cgctp4v09zh3qs7fb"
    },
    {
      "type": "WEB",
      "url": "http://www.openwall.com/lists/oss-security/2024/12/12/1"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N",
      "type": "CVSS_V3"
    },
    {
      "score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N",
      "type": "CVSS_V4"
    }
  ],
  "summary": "Apache Superset: SQLLab Improper readonly query validation allows unauthorized write access"
}

GHSA-78GG-X59J-472C

Vulnerability from github – Published: 2026-01-26 12:30 – Updated: 2026-01-26 12:30
VLAI
Details

The web interface offers a functionality to export the internal SQLite database. After executing the database export, an automatic download is started and the device reboots. After rebooting, the exported database is deleted and cannot be accessed anymore. However, it was noticed that sometimes the device does not reboot and therefore the exported database is not deleted, or the device reboots and the export is not deleted for unknown reasons. The path where the database export is located can be accessed without prior authentication. This leads to the fact that an attacker might be able to get access to the exported database without prior authentication. The database includes sensitive data like passwords, card pins, encrypted Mifare sitekeys and much more.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2025-59100"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-285"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2026-01-26T10:16:07Z",
    "severity": "MODERATE"
  },
  "details": "The web interface offers a functionality to export the internal SQLite database. After executing the database export, an automatic download is started and the device reboots. After rebooting, the exported database is deleted and cannot be accessed anymore. However, it was noticed that sometimes the device does not reboot and therefore the exported database is not deleted, or the device reboots and the export is not deleted for unknown reasons. The path where the database export is located can be accessed without prior authentication. This leads to the fact that an attacker might be able to get access to the exported database without prior authentication. \nThe database includes sensitive data like passwords, card pins, encrypted Mifare sitekeys and much more.",
  "id": "GHSA-78gg-x59j-472c",
  "modified": "2026-01-26T12:30:28Z",
  "published": "2026-01-26T12:30:28Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2025-59100"
    },
    {
      "type": "WEB",
      "url": "https://r.sec-consult.com/dkaccess"
    },
    {
      "type": "WEB",
      "url": "https://r.sec-consult.com/dormakaba"
    },
    {
      "type": "WEB",
      "url": "https://www.dormakabagroup.com/en/security-advisories"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:A/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X",
      "type": "CVSS_V4"
    }
  ]
}

GHSA-78XF-28C3-3286

Vulnerability from github – Published: 2022-12-05 09:30 – Updated: 2022-12-06 18:30
VLAI
Details

A vulnerability has been found in Facepay 1.0 and classified as critical. Affected by this vulnerability is an unknown functionality of the file /face-recognition-php/facepay-master/camera.php. The manipulation of the argument userId leads to authorization bypass. The attack can be launched remotely. The identifier VDB-214789 was assigned to this vulnerability.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2022-4281"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-266",
      "CWE-269",
      "CWE-285"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2022-12-05T07:15:00Z",
    "severity": "HIGH"
  },
  "details": "A vulnerability has been found in Facepay 1.0 and classified as critical. Affected by this vulnerability is an unknown functionality of the file /face-recognition-php/facepay-master/camera.php. The manipulation of the argument userId leads to authorization bypass. The attack can be launched remotely. The identifier VDB-214789 was assigned to this vulnerability.",
  "id": "GHSA-78xf-28c3-3286",
  "modified": "2022-12-06T18:30:19Z",
  "published": "2022-12-05T09:30:22Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2022-4281"
    },
    {
      "type": "WEB",
      "url": "https://vuldb.com/?id.214789"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-79FF-W3CV-55FM

Vulnerability from github – Published: 2023-06-03 03:30 – Updated: 2026-04-08 21:31
VLAI
Details

The VK Blocks plugin for WordPress is vulnerable to improper authorization via the REST 'update_options' function in versions up to, and including, 1.57.0.5. This allows authenticated attackers, with contributor-level permissions or above, to change the 'vk_font_awesome_version' option to an arbitrary value.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2023-0584"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-285"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2023-06-03T02:15:09Z",
    "severity": "MODERATE"
  },
  "details": "The VK Blocks plugin for WordPress is vulnerable to improper authorization via the REST \u0027update_options\u0027 function in versions up to, and including, 1.57.0.5. This allows authenticated attackers, with contributor-level permissions or above, to change the \u0027vk_font_awesome_version\u0027 option to an arbitrary value.",
  "id": "GHSA-79ff-w3cv-55fm",
  "modified": "2026-04-08T21:31:50Z",
  "published": "2023-06-03T03:30:15Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2023-0584"
    },
    {
      "type": "WEB",
      "url": "https://plugins.trac.wordpress.org/browser/vk-blocks/trunk/inc/vk-blocks/font-awesome/class-vk-blocks-font-awesome-api.php"
    },
    {
      "type": "WEB",
      "url": "https://plugins.trac.wordpress.org/changeset/2927751"
    },
    {
      "type": "WEB",
      "url": "https://www.wordfence.com/threat-intel/vulnerabilities/id/b90b7f6c-df7f-48a5-b283-cf5facbd71e5?source=cve"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-79FW-35W8-M7CX

Vulnerability from github – Published: 2025-12-12 21:31 – Updated: 2025-12-17 21:30
VLAI
Details

A logic issue was addressed with improved file handling. This issue is fixed in macOS Sonoma 14.8.3, macOS Sequoia 15.7.3. An app may be able to access protected user data.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2025-46289"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-285"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2025-12-12T21:15:58Z",
    "severity": "MODERATE"
  },
  "details": "A logic issue was addressed with improved file handling. This issue is fixed in macOS Sonoma 14.8.3, macOS Sequoia 15.7.3. An app may be able to access protected user data.",
  "id": "GHSA-79fw-35w8-m7cx",
  "modified": "2025-12-17T21:30:44Z",
  "published": "2025-12-12T21:31:39Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2025-46289"
    },
    {
      "type": "WEB",
      "url": "https://support.apple.com/en-us/125886"
    },
    {
      "type": "WEB",
      "url": "https://support.apple.com/en-us/125887"
    },
    {
      "type": "WEB",
      "url": "https://support.apple.com/en-us/125888"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N",
      "type": "CVSS_V3"
    }
  ]
}

Mitigation
Architecture and Design
  • Divide the product into anonymous, normal, privileged, and administrative areas. Reduce the attack surface by carefully mapping roles with data and functionality. Use role-based access control (RBAC) to enforce the roles at the appropriate boundaries.
  • Note that this approach may not protect against horizontal authorization, i.e., it will not protect a user from attacking others with the same role.
Mitigation
Architecture and Design

Ensure that you perform access control checks related to your business logic. These checks may be different than the access control checks that you apply to more generic resources such as files, connections, processes, memory, and database records. For example, a database may restrict access for medical records to a specific database user, but each record might only be intended to be accessible to the patient and the patient's doctor.

Mitigation MIT-4.4
Architecture and Design

Strategy: Libraries or Frameworks

  • Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid.
  • For example, consider using authorization frameworks such as the JAAS Authorization Framework [REF-233] and the OWASP ESAPI Access Control feature [REF-45].
Mitigation
Architecture and Design
  • For web applications, make sure that the access control mechanism is enforced correctly at the server side on every page. Users should not be able to access any unauthorized functionality or information by simply requesting direct access to that page.
  • One way to do this is to ensure that all pages containing sensitive information are not cached, and that all such pages restrict access to requests that are accompanied by an active and authenticated session token associated with a user who has the required permissions to access that page.
Mitigation
System Configuration Installation

Use the access control capabilities of your operating system and server environment and define your access control lists accordingly. Use a "default deny" policy when defining these ACLs.

CAPEC-1: Accessing Functionality Not Properly Constrained by ACLs

In applications, particularly web applications, access to functionality is mitigated by an authorization framework. This framework maps Access Control Lists (ACLs) to elements of the application's functionality; particularly URL's for web apps. In the case that the administrator failed to specify an ACL for a particular element, an attacker may be able to access it with impunity. An attacker with the ability to access functionality not properly constrained by ACLs can obtain sensitive information and possibly compromise the entire application. Such an attacker can access resources that must be available only to users at a higher privilege level, can access management sections of the application, or can run queries for data that they otherwise not supposed to.

CAPEC-104: Cross Zone Scripting

An attacker is able to cause a victim to load content into their web-browser that bypasses security zone controls and gain access to increased privileges to execute scripting code or other web objects such as unsigned ActiveX controls or applets. This is a privilege elevation attack targeted at zone-based web-browser security.

CAPEC-127: Directory Indexing

An adversary crafts a request to a target that results in the target listing/indexing the content of a directory as output. One common method of triggering directory contents as output is to construct a request containing a path that terminates in a directory name rather than a file name since many applications are configured to provide a list of the directory's contents when such a request is received. An adversary can use this to explore the directory tree on a target as well as learn the names of files. This can often end up revealing test files, backup files, temporary files, hidden files, configuration files, user accounts, script contents, as well as naming conventions, all of which can be used by an attacker to mount additional attacks.

CAPEC-13: Subverting Environment Variable Values

The adversary directly or indirectly modifies environment variables used by or controlling the target software. The adversary's goal is to cause the target software to deviate from its expected operation in a manner that benefits the adversary.

CAPEC-17: Using Malicious Files

An attack of this type exploits a system's configuration that allows an adversary to either directly access an executable file, for example through shell access; or in a possible worst case allows an adversary to upload a file and then execute it. Web servers, ftp servers, and message oriented middleware systems which have many integration points are particularly vulnerable, because both the programmers and the administrators must be in synch regarding the interfaces and the correct privileges for each interface.

CAPEC-39: Manipulating Opaque Client-based Data Tokens

In circumstances where an application holds important data client-side in tokens (cookies, URLs, data files, and so forth) that data can be manipulated. If client or server-side application components reinterpret that data as authentication tokens or data (such as store item pricing or wallet information) then even opaquely manipulating that data may bear fruit for an Attacker. In this pattern an attacker undermines the assumption that client side tokens have been adequately protected from tampering through use of encryption or obfuscation.

CAPEC-402: Bypassing ATA Password Security

An adversary exploits a weakness in ATA security on a drive to gain access to the information the drive contains without supplying the proper credentials. ATA Security is often employed to protect hard disk information from unauthorized access. The mechanism requires the user to type in a password before the BIOS is allowed access to drive contents. Some implementations of ATA security will accept the ATA command to update the password without the user having authenticated with the BIOS. This occurs because the security mechanism assumes the user has first authenticated via the BIOS prior to sending commands to the drive. Various methods exist for exploiting this flaw, the most common being installing the ATA protected drive into a system lacking ATA security features (a.k.a. hot swapping). Once the drive is installed into the new system the BIOS can be used to reset the drive password.

CAPEC-45: Buffer Overflow via Symbolic Links

This type of attack leverages the use of symbolic links to cause buffer overflows. An adversary can try to create or manipulate a symbolic link file such that its contents result in out of bounds data. When the target software processes the symbolic link file, it could potentially overflow internal buffers with insufficient bounds checking.

CAPEC-5: Blue Boxing

This type of attack against older telephone switches and trunks has been around for decades. A tone is sent by an adversary to impersonate a supervisor signal which has the effect of rerouting or usurping command of the line. While the US infrastructure proper may not contain widespread vulnerabilities to this type of attack, many companies are connected globally through call centers and business process outsourcing. These international systems may be operated in countries which have not upgraded Telco infrastructure and so are vulnerable to Blue boxing. Blue boxing is a result of failure on the part of the system to enforce strong authorization for administrative functions. While the infrastructure is different than standard current applications like web applications, there are historical lessons to be learned to upgrade the access control for administrative functions.

{'xhtml:b': 'This attack pattern is included in CAPEC for historical purposes.'}

CAPEC-51: Poison Web Service Registry

SOA and Web Services often use a registry to perform look up, get schema information, and metadata about services. A poisoned registry can redirect (think phishing for servers) the service requester to a malicious service provider, provide incorrect information in schema or metadata, and delete information about service provider interfaces.

CAPEC-59: Session Credential Falsification through Prediction

This attack targets predictable session ID in order to gain privileges. The attacker can predict the session ID used during a transaction to perform spoofing and session hijacking.

CAPEC-60: Reusing Session IDs (aka Session Replay)

This attack targets the reuse of valid session ID to spoof the target system in order to gain privileges. The attacker tries to reuse a stolen session ID used previously during a transaction to perform spoofing and session hijacking. Another name for this type of attack is Session Replay.

CAPEC-647: Collect Data from Registries

An adversary exploits a weakness in authorization to gather system-specific data and sensitive information within a registry (e.g., Windows Registry, Mac plist). These contain information about the system configuration, software, operating system, and security. The adversary can leverage information gathered in order to carry out further attacks.

CAPEC-668: Key Negotiation of Bluetooth Attack (KNOB)

An adversary can exploit a flaw in Bluetooth key negotiation allowing them to decrypt information sent between two devices communicating via Bluetooth. The adversary uses an Adversary in the Middle setup to modify packets sent between the two devices during the authentication process, specifically the entropy bits. Knowledge of the number of entropy bits will allow the attacker to easily decrypt information passing over the line of communication.

CAPEC-76: Manipulating Web Input to File System Calls

An attacker manipulates inputs to the target software which the target software passes to file system calls in the OS. The goal is to gain access to, and perhaps modify, areas of the file system that the target software did not intend to be accessible.

CAPEC-77: Manipulating User-Controlled Variables

This attack targets user controlled variables (DEBUG=1, PHP Globals, and So Forth). An adversary can override variables leveraging user-supplied, untrusted query variables directly used on the application server without any data sanitization. In extreme cases, the adversary can change variables controlling the business logic of the application. For instance, in languages like PHP, a number of poorly set default configurations may allow the user to override variables.

CAPEC-87: Forceful Browsing

An attacker employs forceful browsing (direct URL entry) to access portions of a website that are otherwise unreachable. Usually, a front controller or similar design pattern is employed to protect access to portions of a web application. Forceful browsing enables an attacker to access information, perform privileged operations and otherwise reach sections of the web application that have been improperly protected.