.pi/prompts/sa.md
Update a GitHub security advisory for publication: $ARGUMENTS
Use gh for all GitHub operations. Do not publish the advisory, change its state, or request a CVE unless the user explicitly agrees or the draft markdown explicitly says request_cve: true.
GitHub does not expose repository security advisory comments/discussion through the documented REST OpenAPI schema or public GraphQL schema. A 404 from guessed API endpoints such as api.github.com/repos/.../security-advisories/<GHSA>/comments, .../timeline, or .../events is expected and is not, by itself, an auth failure. Do not use a browser session, browser cookies, or cookie extraction to fetch advisory comments. Instead, clearly tell the user that advisory comments were not included and that they can paste any relevant comments if they want them considered.
$ARGUMENTS is a GitHub security advisory URL, start the investigation and drafting workflow.$ARGUMENTS is a path to an existing markdown draft, read it and apply that draft to the advisory.owner, repo, and GHSA id.gh api repos/<owner>/<repo>/security-advisories/<GHSA>
/comments, /timeline, or /events; they commonly return 404 because GitHub does not expose draft advisory comments through the public API.Advisory comments were not included because GitHub does not expose them through the public API. Paste any relevant comments if you want them considered./tmp, for example /tmp/sa-<GHSA>.md. Include both the original CVSS from the advisory and the proposed/confirmed updated CVSS.The draft file must contain YAML frontmatter followed by the advisory body. Include all fields needed to update GitHub and to decide whether to request a CVE.
---
advisory_url: https://github.com/<owner>/<repo>/security/advisories/<GHSA>
owner: <owner>
repo: <repo>
ghsa_id: <GHSA>
summary: <short advisory summary>
original_severity: <low|medium|high|critical|null>
original_cvss_vector: <original CVSS:3.1/... or null>
original_cvss_score: <original number or null>
severity: <proposed/confirmed low|medium|high|critical>
cvss_vector: <proposed/confirmed CVSS:3.1/...>
cvss_score: <proposed/confirmed number>
cwe_ids:
- CWE-...
vulnerabilities:
- package:
ecosystem: npm
name: <package-name>
vulnerable_version_range: <range>
patched_versions: <range-or-version>
request_cve: false
---
# <Advisory title>
<Concise description of the vulnerability and vulnerable behavior.>
## Info
<Technical explanation of the root cause and affected component. Focus on facts needed by defenders and maintainers. Do not include PoC steps, exploit payloads, or copy-pastable exploit strings.>
## Impact
<Who can exploit it, prerequisites, confidentiality/integrity/availability impact, and realistic deployment assumptions.>
## Affected versions
- Affected: `<range>`
- Patched: `<version or range>`
## The solution
<Describe the fix and the patched release.>
## Recommendations
<Upgrade guidance and operational mitigations.>
## Workarounds
<Workarounds if any; otherwise skip this section entirely>
## Timeline
- YYYY-MM-DD: Report received
- YYYY-MM-DD: Fix committed
- YYYY-MM-DD: Fixed version released
- YYYY-MM-DD: Advisory published
## Credits
<Reporter/researcher attribution if appropriate, otherwise skip section.>
## References
- <links to releases, commits, advisories, documentation>
Use the curl advisory style as inspiration: clear sections, direct language, affected/fixed version facts, recommendations, timeline, and credits. Do not include a PoC.
When the user approves with "update"/similar or provides a markdown path:
summary from frontmatterdescription from the markdown body after frontmatterseverity from frontmatter if presentcvss_vector_string from cvss_vectorcwe_ids from frontmattervulnerabilities from frontmatteroriginal_severity, original_cvss_vector, or original_cvss_score; those fields are retained only for audit context.gh api -X PATCH repos/<owner>/<repo>/security-advisories/<GHSA> --input /tmp/<payload>.json
request_cve: true, request a CVE with:
gh api -X POST repos/<owner>/<repo>/security-advisories/<GHSA>/cve
request_cve: true is present in the markdown file.