security: ZAP severity gate reads alert.url, so every URL-scoped exception in .zap/rules.tsv is inert
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- Mezza giornata
- Idoneità per principianti
- 88/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- javascript
Direzione di ricerca
Parti da scripts/check-zap-severity.mjs e dal punto in cui legge alert.url; aggiungi un helper di risoluzione URL che preferisca alert.instances[].uri con alert.url come fallback, e verifica dove viene stampato il testo (no url). Poi aggiungi un test unitario che fissi la forma dell'alert di ZAP 0.15.0 (array instances, nessun url di primo livello) e un test che dimostri che una riga con scope URL in .zap/rules.tsv corrisponde solo all'URL previsto — assicurati che sia il fixture rules.tsv, non quello reale del repository, a essere testato. Fatto significa che tutti i criteri di accettazione sono spuntati e che i test esistenti passano ancora.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
scripts/check-zap-severity.mjs reads the affected URL from alert.url, but the ZAP
baseline action (zaproxy/action-baseline) does not set a top-level url on alerts.
Observed URLs live in alert.instances[].uri, with the alert acting as a group.
The practical effect: every URL-scoped exception in .zap/rules.tsv silently fails to
match, and the scope column is inert. A row intended to waive one bundle path either
does not apply at all, or — depending on the branch taken — applies rule-wide. A narrow,
reviewed waiver quietly becomes something other than what was written.
Proof
Running this repo's own script against a real-shape ZAP report, alonga corrected version,
with an identical rules.tsv:
report: {"pluginid":"10003","riskcode":"3","instances":[{"uri":".../main-ABC123.js"}]}
rules: 10003 IGNORE /main- <issue> <owner> 2027-01-01 reason
this script (alert.url): "- [10003] Vulnerable JS Library: High (Medium) (no url)" EXIT 1
corrected (instances[].uri): "no unexcepted medium- or high-risk alerts" EXIT 0
The (no url) in the failure output is the tell — it is printed on every real finding.
Fleet status
| repo | state |
|---|---|
GSA/sam-design-system |
already correct — reads instances[].uri with a documented url fallback |
GSA/ngx-uswds-icons |
not affected — rule-id-only gate, no URL scoping |
GSA/sam-styles |
no script |
GSA/ngx-uswds |
affected |
GSA/sam-ui-elements |
affected |
Suggested fix
Port the resolution helper from GSA/sam-design-system's copy of this script, which
already handles both shapes. Equivalent shape:
function urlsOf(alert) {
const fromInstances = Array.isArray(alert.instances)
? alert.instances.map((i) => String(i?.uri ?? '')).filter((u) => u.length > 0)
: [];
return alert.url === undefined || alert.url === null
? fromInstances
: [...fromInstances, String(alert.url)];
}
Acceptance criteria
- Scope matching reads
alert.instances[].uri, retainingalert.urlonly as a fallback - Failure output prints real URLs instead of
(no url) - A unit test pins the actual ZAP 0.15.0 alert shape (instances array, no top-level
url) - A test proves a URL-scoped exception matches the intended URL and does not match a different one
- Existing
.zap/rules.tsvrows are re-reviewed — scopes were never enforced, so each may be broader than intended
Note on test harnesses
When writing the test, make sure the fixture rules.tsv is actually the file under test.
A first attempt at this test elsewhere passed for the wrong reason because the harness fell
through to the repository's real .zap/rules.tsv.
Reference
Fixed in GSA/sam-layouts via PR #93 (issue #80), with 5 tests pinning the real shape.
- Lingua principale
- TypeScript
- Stelle
- 8
- Fork
- 34
- Merge medio
- 2g 14h
- PR unite (30g)
- 5
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di GSA/sam-ui-elements
-
tech-debt
Difficoltà 4/5 3-5 giorni Idoneità per principianti 56/100
GSA/sam-ui-elements#708 ·
I maintainer di solito rispondono entro 1 giorno
-
disablePageTabIndex() sets aria-hidden on the focused calendar button, and enablePageTabIndex() never removes itForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Apertabugfix
Difficoltà 4/5 3-5 giorni Idoneità per principianti 68/100
GSA/sam-ui-elements#682 ·
I maintainer di solito rispondono entro 1 giorno
-
bugfix
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
GSA/sam-ui-elements#681 ·
I maintainer di solito rispondono entro 1 giorno
-
Burn down ESLint and Angular lint debtForse di nuovo libera @fpigeonjr l’ha presa 63 giorni fa e non c’è nessuna pull request aperta. Apertaangular-upgrade maintenance
GSA/sam-ui-elements#580 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
sam-ui-elements pipeline modernization + Angular 19→21 upgrade (SAM Angular upgrade — 4th tracer bullet) — IAEMOD-61187Forse di nuovo libera @fpigeonjr l’ha presa 75 giorni fa e non c’è nessuna pull request aperta. Apertaangular-upgrade maintenance
GSA/sam-ui-elements#562 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di GSA/sam-ui-elements
Issue simili
-
e2e-failure ready-to-code
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
redhat-developer/rhdh-plugin-export-overlays#4616 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
I maintainer di solito rispondono entro 1 giorno
-
ai-handle
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
nextlevelbuilder/dewee-web-v2#73 ·
I maintainer di solito rispondono entro 1 giorno
-
backend bug good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
PoCInnovation/Distribox#255 ·
I maintainer di solito rispondono entro 1 giorno