Skip to content

feat(cve-tool-vulnogram): authenticate with a /users/token Bearer token - #1387

Merged
potiuk merged 1 commit into
apache:mainfrom
potiuk:vulnogram-bearer-token
Sep 25, 2026
Merged

potiuk merged 1 commit into
apache:mainfrom
potiuk:vulnogram-bearer-token

Conversation

@potiuk

@potiuk potiuk commented Sep 25, 2026

Copy link
Copy Markdown
Member

Summary

  • The Vulnogram API helpers (tools/cve-tool-vulnogram/oauth-api) no longer take the browser's connect.sid session cookie.
    The operator logs in (MFA included) in their own browser, copies a token from https://cveprocess.apache.org/users/token, and vulnogram-api-setup stores that.
    The tool never handles the password, the MFA factor, or the full-power session cookie.
  • The PMC-scoped write token is the recommended pick: the server accepts it only on /cve5/CVE-* and /cve5/json/CVE-*, and refuses it on /allocatecve and everything else.
  • Bearer-authenticated requests are exempt from CSRF on the server, so an update is a single POST instead of a CSRF-token scrape plus a POST.
    The probe moves to /cve5/json/CVE-0000-00000, because /cve5/new is not on the token allowlist.
  • A session file from the old cookie flow is refused with a pointer to /users/token.

Server-side behaviour follows ensureAuthenticated in apache/security-vulnogram@app.js and the /users/token route in custom/asf.js (apache/security-vulnogram#211, #212, #228, #252).

Type of change

  • Skill change (.claude/skills/<name>/) — eval fixtures updated below
  • Tool / bridge contract (tools/<system>/*.md)
  • Python package (tools/*/ with pyproject.toml)
  • Groovy reference impl
  • Cross-cutting (RFC, AGENTS.md, sandbox, privacy-LLM)
  • Documentation (docs/, README.md, CONTRIBUTING.md)
  • Project template (projects/_template/)
  • CI / dev loop (prek, workflows, validators)
  • Other:

Test plan

  • prek run --all-files passes
  • For Python packages touched: uv run pytest / ruff check / mypy passes
  • For Groovy bridges touched: command-line invocation tested end-to-end
  • For skill changes: eval suite passes for the affected skill
  • For skill behaviour changes: a new or updated eval fixture is included in this PR
  • Other: not yet exercised against the live cveprocess.apache.org — worth one vulnogram-api-setup + vulnogram-api-check + vulnogram-api-record-fetch round-trip with a real write token before merge.

The issue-sync subdoc edits are wording only (cookie → token, and exit code 4 dropped from the exit-code list), so no eval rerun.

RFC-AI-0004 compliance

  • Sandbox — no new host access; the tool holds a narrower credential than before (scoped, short-lived token instead of the full session cookie)
  • Write-access discipline — no change to when records are written; still proposal-gated by the skills

Linked issues

Notes for reviewers (optional)

  • Tokens live only as long as the browser login that minted them (hours), and ASF Vulnogram offers no long-lived token, so re-running setup becomes more frequent than with the cookie.
  • Exit code 4 (CSRF scrape failed) of vulnogram-api-record-update / -publish is retired; the other codes keep their meaning.
  • Allocation through the allocate token on /allocatecve is not wired up here; the tool still only writes records.
  • The token file keeps its path (~/.config/apache-magpie/vulnogram-session.json) and the VULNOGRAM_SESSION env var.

Generative AI disclosure: drafted with Claude Code (Claude Opus 5); reviewed and verified by the author.

🤖 Generated with Claude Code

The Vulnogram API helpers no longer take the browser's connect.sid
session cookie. The operator logs in (MFA included) in their own
browser, copies a token from https://cveprocess.apache.org/users/token,
and vulnogram-api-setup stores that instead. The tool never handles the
password, the MFA factor, or the full-power session cookie.

The PMC-scoped `write` token is the recommended pick: the server accepts
it only on /cve5/CVE-* and /cve5/json/CVE-*. Bearer-authenticated
requests are exempt from CSRF, so updates are a single POST with no
CSRF-token scrape. The probe moves to /cve5/json/CVE-0000-00000,
because /cve5/new is not on the token allowlist.

A session file written by the old cookie flow is refused with a pointer
to /users/token.

Generated-by: Claude Opus 5
@potiuk
potiuk merged commit 4ffd5d0 into apache:main Sep 25, 2026
9 checks passed
@potiuk potiuk added capability:intake Import external signal + sync tracker state contract:cve-authority Tool capability: CVE allocation / record management / publication family:docs Docs, MISSION.md, READMEs family:security security-* skills family:tools tools/* labels Oct 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

capability:intake Import external signal + sync tracker state contract:cve-authority Tool capability: CVE allocation / record management / publication family:docs Docs, MISSION.md, READMEs family:security security-* skills family:tools tools/*

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant