Clear the four CodeQL alerts in the release scripts (replaceAll for %2F, comment-line check)

Geschlossen Anfängerfreundlich
#5,261 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
83/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
github, typescript
Bereich
devtools, security

Rechercherichtung

Beginne mit scripts/npm-publish-guard.mjs, scripts/release-notes.mjs und scripts/release-notes.test.mjs und führe dann npm run test:scripts aus. Aktualisiere die drei Schrägstrich-Ersetzungen und die Prüfung generierter Kommentare wie im Issue beschrieben; fertig ist die Arbeit, wenn die bestehenden Skripttests bestehen und der CodeQL-Lauf des PR alle vier Alerts als behoben markiert.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

chore v2

Problem

Four CodeQL alerts are open on main, all in release tooling. None is exploitable, but they keep the code-scanning page non-empty, and a dismissed pattern is flagged again wherever it is copied.

Alert Rule Location (v2/main) Flagged Why it is not a vulnerability
#37 js/incomplete-sanitization scripts/npm-publish-guard.mjs:45 (packageUrl) name.replace("/", "%2F") replaces only the first / npm names hold at most one / (@scope/name); inputs are this repo's own manifests; the URL is a read-only registry lookup
#38 js/incomplete-sanitization scripts/release-notes.mjs:229 (registryUrl) same same
#39 js/incomplete-sanitization scripts/release-notes.test.mjs:465 (fake fetch) same test code mirroring the above
#36 js/bad-tag-filter scripts/release-notes.mjs:299 /^<!--.*-->$/ does not match a multi-line comment not a sanitizer: it skips GitHub's one-line <!-- Release notes generated… --> marker while parsing GitHub's own generated notes line by line; an unexpected line aborts with "unrecognized line" rather than passing through

Expected

One PR, no behavior change:

  • .replace("/", "%2F") → .replaceAll("/", "%2F") in all three places.
  • The comment check at release-notes.mjs:299 → line.startsWith("<!--") && line.endsWith("-->").
  • The existing tests in scripts/*.test.mjs pass unchanged (npm run test:scripts); add a case only if a branch loses coverage.
  • After the PR's CodeQL run, the four alerts show as fixed on the PR, and close on main at the next milestone merge.

Notes

  • Found while closing out v2.1.0 (#5243). The two CORS alerts from that release (#42, #43) were dismissed as false positives; #40 and #41 closed as fixed when v2.1.0 replaced origin: "*".
  • No changeset: the scripts are not part of any published package.
Vorherrschende Sprache
TypeScript
Sterne
91.7k
Forks
11.9k
Ø Merge
4 Std. 14 Min.
Gemergte PRs (30 T.)
228

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus modelcontextprotocol/servers

Alle Issues in modelcontextprotocol/servers

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.