Skip to main content

Findings API

Every scanner that can block a merge exposes its findings over the REST API. When a commit status says “merge blocked”, this is where you read the specific findings behind it, and where you dismiss the ones you accept.

This is the same data as /<org>/_admin/code-security in the admin UI — the UI is a client of these endpoints.

The path segments do not match the status names

This is the one thing worth memorising. The commit-status context and the API path segment differ:

ScannerCommit status you see on the PRAPI path segment
Static analysisfremforge/sastsast
Dependenciesfremforge/dep-scandeps
Container imagesfremforge/image-scanimages
Licensesfremforge/license-scanlicenses

Guessing the segment from the status name returns 501 Not Implemented from the API’s catch-all, which reads as “documented but not yet shipped”. It is not — you have the wrong URL.

Base URL

The product API is served under /_app, not at the apex (the apex is Forgejo’s own API):

https://frem.sh/_app/api/v1/orgs/<org>/code-security/<scanner>/findings

Authenticate with an org API token or a PAT — see the API reference for the token types.

Every finding in one list

To read every open finding at once, whatever the scanner, use the one list. It is the list on Security › Findings › All:

curl -sS \
  -H "Authorization: Bearer ${FREMFORGE_TOKEN}" \
  "https://frem.sh/_app/api/v1/orgs/acme/security/findings?severity=critical,high"
{
  "counts": { "code": 3, "secrets": 0, "dependencies": 41, "images": 12, "iac": 5, "licences": 2, "malware": 0 },
  "items": [
    {
      "type": "dependencies",
      "id": "0f6c…",
      "severity": "critical",
      "title": "GHSA-xxxx-xxxx-xxxx",
      "subject": "acme/api",
      "detail": "lodash@4.17.20",
      "pr_number": null,
      "known_exploited": true,
      "first_seen_at": "2026-10-02T08:14:03.120Z"
    }
  ],
  "next_cursor": "eyJr…"
}
  • type: a comma list of code, secrets, dependencies, images, iac, licences and malware. The default is all of them. Infrastructure-as-code findings are their own type here, although the scan that finds them is the image scan.
  • severity: a comma list of critical, high, medium and low.
  • repo: one repository (owner/name) or image.
  • limit: 1–200, default 50. For the next page, pass the next_cursor you got back as cursor. It is null on the last page.

The order is the console’s: known exploited first, then severity, then the oldest, so the finding closest to its fix-by date comes first. Severities are made comparable across scanners: a SAST error is high, a warning medium and anything else low; a forbidden licence is critical, a restricted one high and any other low; secrets and malware are always critical. counts holds the open findings per type for the whole organisation, without the filters. Requires findings:read. An unknown type or severity answers 400.

  • branch: a protected release branch, for example release/1.x, to list that branch’s findings instead of the default branch’s. Each row then also carries branch and fix_by. A branch that has not been scanned answers 404 unknown-branch. GET /orgs/{org}/security/release-branches lists the scanned ones.

A row carries what the list shows. For the full finding (reachability, triage, dependency path) and for dismissing it, use the scanner’s own endpoint below with the row’s id.

List findings

Open findings only, by default:

curl -sS \
  -H "Authorization: Bearer ${FREMFORGE_TOKEN}" \
  "https://frem.sh/_app/api/v1/orgs/acme/code-security/images/findings?limit=50"
{
  "findings": [
    {
      "id": "0f6c…",
      "registry_image": "acme/api@9f2c…",
      "cve_id": "CVE-2026-59950",
      "package": "mcp",
      "severity": "high",
      "fixed_version": "1.28.1",
      "dismissed_at": null,
      "created_at": "2026-07-25T06:33:41.940Z"
    }
  ],
  "has_more": false
}

Query parameters, all four scanners:

  • limit — 1–200, default 50.
  • offset — page with offset += limit until has_more is false.
  • include_dismissed — set true to see dismissed findings too.

The response fields differ per scanner, because the findings do: images returns cve_id / package / fixed_version, deps adds ecosystem / manifest_path / current_version and, for default-branch findings, via / dependency_path (which direct dependency brings the package in, see dependency paths), licenses returns license_id / category, and sast returns rule_id / path / line. The OpenAPI spec carries the exact schema for each.

Two more fields come from reachability and triage: deps and images findings carry a reachability object and an sla object (the deadline in force, with the opt-in multiplier applied), and sast findings carry a triage object (location, taint path, dismissal history and whether the finding is in the lower-confidence group). deps and images also take ?reachability= to filter by verdict. All three take ?sort=risk to list in triage order: for deps and images the reachability verdict, then severity, then known exploited, then EPSS; for sast the triage signals (the lower-confidence group last, then severity, then a taint trace before an unknown or pattern-only match, then the oldest first). Paging with offset is stable in either order. The default order is newest first, with ties broken by id.

deps and images findings also carry known_exploited: null, or { "cve_ids": [...], "sources": [...] } when the vulnerability is listed as exploited in the wild by ENISA’s EU Vulnerability Database (euvd) or CISA’s KEV catalogue (cisa_kev). A dependency finding is matched through the CVE aliases of its advisory, an image finding by its CVE id; both lists are refreshed daily. Add ?known_exploited=true to list only those findings, or ?known_exploited=false for the rest; any other value answers 400. The console’s Dependencies and Container images lists have the same filter, Known exploited only, and Security fixes opens their fix pull requests first.

Dependency health

Dependency health findings (abandoned, deprecated or moved packages) have their own path, under deps:

curl -sS \
  -H "Authorization: Bearer ${FREMFORGE_TOKEN}" \
  "https://frem.sh/_app/api/v1/orgs/acme/code-security/deps/health/findings?kind=moved"
{
  "findings": [
    {
      "id": "7c1e…",
      "repo_full_name": "acme/web",
      "ecosystem": "npm",
      "package_name": "opencode-ai",
      "kind": "moved",
      "current_version": "1.19.5",
      "manifest_paths": ["package.json"],
      "evidence": "Last stable release 1.19.5 on 28 Oct. The project is now at 2.2.6 under @opencode/cli.",
      "reasons": ["major-not-published"],
      "source_repo": "anomalyco/opencode",
      "source_origin": "hints",
      "replacement": { "package": "@opencode/cli", "version": "2.2.6", "reason": "same-source-same-command", "install": "npm install @opencode/cli@2.2.6" },
      "state": "open",
      "first_seen_at": "2026-11-07T20:12:03.000Z",
      "reopened_at": null,
      "resolved_at": null,
      "dismissed_at": null
    }
  ],
  "has_more": false
}

It takes limit, offset and include_dismissed like the other lists, plus include_resolved (findings no longer detected), kind (moved, deprecated, abandoned or stale; any other value answers 400, and stale findings are listed only with kind=stale), repo (acme/web, or just web) and ecosystem (npm, pypi, …). Findings come newest first. GET …/deps/health/findings/{id} returns one finding in any state. evidence is the sentence the console shows, in English. reasons says why a moved finding was raised: major-not-published, quiet (no release for 30 days while the source repository kept releasing) or archived. source_origin says where the source repository came from: registry, hints (.fremforge/dependency-sources.json) or renovate-rule. replacement.reason is same-source-same-command, same-source or renovate-replacement, and replacement.install is the install command in the package’s own ecosystem, or null where there is no single one. The API only reads these findings: dismiss and reopen them in the console. fremforge keeps a history of when each one was opened, dismissed and resolved, as for other findings, but they are not vulnerabilities, so they do not count in the security trends, remediation metrics or the compliance report.

Needs migration

A deps finding with a null fixed_version carries needs_migration when its advisory is fixed only under another package, such as a new Go module path or major (github.com/docker/docker to github.com/moby/moby/v2) or a renamed package (npm request to @cypress/request). It is null otherwise:

"fixed_version": null,
"needs_migration": { "package": "github.com/moby/moby/v2", "fixed_version": "2.0.0-beta.8" }

No fix pull request is offered for such a finding; see Needs migration.

When a finding closes

Findings tables are insert-only: every scan writes a fresh set of rows under a new scan run, and nothing is deleted when you fix the underlying problem. Two things close a finding.

Superseded automatically. An hourly job resolves findings whose scan run is no longer the latest for their target, marking them dismissed_by: auto-resolve. “Target” is the natural identity for each scanner:

scannertarget identity
sastrepo + file path
deps, licensesrepo + manifest path
imagesimage reference

So the effective rule is “if the most recent scan of that target didn’t re-emit it, it’s gone” — the same semantics OSV and Trivy use. Fix it, let a later scan run, and it clears within the hour. Note the trigger is a newer scan of the same target, not the merge itself: if nothing re-scans that target, the row stays open indefinitely.

There is a deliberate safety property here — only the latest scan run supersedes. A misconfigured scan that emits nothing for a target does not wipe that target’s findings, so a broken scanner cannot silently clear your dashboard.

Dismissed explicitly. You dismiss it, with a reason. Manual dismissals are preserved by the auto-resolve pass, so your reason is never overwritten.

A dismissal can expire. Give it an expires_at (the API) or an Expires on date (the admin pages) and the acceptance lapses on its own: a daily job reopens the finding once the date passes, records on the audit log who had dismissed it and why, and — for a high or critical finding — sends the same security alert a new finding gets. A date means through that day, ending at midnight Europe/Copenhagen. Without a date a dismissal never expires, which is the default and how every earlier dismissal behaves. The expiry is carried forward with the dismissal across later scans, so a re-scan cannot turn a temporary acceptance into a permanent one.

What an image-scan dismissal covers. A dismissed container-image finding stays dismissed in later scans of the same repository or image, but only for the same CVE or rule in the same file (the finding’s target). If the same rule turns up in another file, including a file added later, that is a separate finding and it blocks on its own. So dismissing KSV-0014 on one manifest does not accept it for the next Deployment someone adds.

In practice: fix at source and let the next scan supersede it. Dismiss when you are accepting the finding, or when no further scan of that target is expected — for example a finding tied to a branch that has since merged and is no longer scanned.

Dismiss a finding

reason is required, is stored on the finding, and is written to the audit log — write it for whoever reads it in six months.

curl -sS -X POST \
  -H "Authorization: Bearer ${FREMFORGE_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{"reason":"Fixed at source in acme/api#412; stale PR-scoped row."}' \
  "https://frem.sh/_app/api/v1/orgs/acme/code-security/images/findings/0f6c…/dismiss"
{ "dismissed": true, "expires_at": null, "id": "0f6c…" }

Add expires_at to make the acceptance temporary — a date ("2026-12-31", accepted through that day) or an ISO 8601 timestamp with a zone. It must be in the future and within three years; anything else is a 400 invalid-expires-at. The response echoes the stored instant:

{ "dismissed": true, "expires_at": "2026-12-31T23:00:00.000Z", "id": "0f6c…" }

A 404 means no open finding with that id — most often it is already dismissed.

To close many at once, sast, deps and images accept up to 1000 ids per call:

curl -sS -X POST \
  -H "Authorization: Bearer ${FREMFORGE_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{"ids":["0f6c…","1a2b…"],"reason":"Accepted: vendored fixture, not shipped."}' \
  "https://frem.sh/_app/api/v1/orgs/acme/code-security/deps/findings/bulk-dismiss"

licenses has single dismissal only — there is no bulk endpoint for it.

Reading is not ingesting

Two similar-looking paths do different jobs:

  • /orgs/<org>/code-security/images/findings — what this page describes. Org-scoped, read and dismiss.
  • /_app/api/v1/image-scans/findings — the ingest endpoint the scanner runner POSTs results to. Not for reading.

Settings

Each scanner’s blocking threshold is also an API call — PUT /orgs/<org>/code-security/<scanner>/settings. Note that images gates on block_action while sast, deps and licenses gate on block_severity; the images threshold is the image_scan entry of the org scan policy (PUT /orgs/<org>/policy, see block threshold); licenses additionally takes allowlisted_license_ids.

For deps there is one more, opt-in policy: PUT /orgs/<org>/security/dep-scan-unreachable-policy ({"enabled": true, "repos": [...]}, scope policy:write) stops a pull request finding whose reachability verdict is not reachable from blocking fremforge/dep-scan. It is off by default; unknown, malware and known-exploited findings always block, and a false “not reachable” lets a real vulnerability merge. See Reachability: do not block on not-reachable findings. A finding it let through carries block_waived: "unreachable" in the list above.

See also