Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

Telemetry scrubber: case-insensitive mysql rule redacts an attached port (-P3306) and lets a real password survive in the same command

Offen Anfängerfreundlich
#815 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

@charan-rathore arbeitet bereits daran.

Seit 21.10.2026.

  • #819 von @charan-rathore — offen

Bewertung

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

Rechercherichtung

Beginne in server/src/telemetry/scrub.ts und untersuche die mysql-Regel für Zugangsdaten zusammen mit der benachbarten sshpass-Regel. Ergänze Tests für den gemischten Befehl -P3306 und -phunter2, das kleingeschriebene angehängte -p3306 und mysql -p database; bestätige, dass Port und Datenbankname erhalten bleiben, während tatsächliche Zugangsdaten unkenntlich gemacht werden.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Summary

In server/src/telemetry/scrub.ts, the tool-anchored mysql credential rule keeps the i flag:

[
  /(\bmysql(?:dump)?\b(?:[^|;&\\\r\n]|\\[\s\S])*?(?:[ \t]|\\\r?\n)-p)("[^"]*"|'[^']*'|[^\s'"-]\S*)/gi,
  (_m, lead) => `${lead}${REDACTED}`,
],

i makes (?:[ \t])-p match the uppercase attached port form -P3306 (mysql's syntax for --port attached to a single dash). Because the g continuation after the first match never sees another \bmysql\b anchor, a real password later in the same command line is not redacted.

Repro (upstream tree at e8bb2736)

scrubCommand("mysql -h db -P3306 -phunter2 app")
→ "mysql -h db -P[REDACTED] -phunter2 app"

The port is redacted as if it were a secret, and the actual password -phunter2 survives into OTLP export — contrary to the module header's stated priority ("a secret that survived costs a rotation") and to the sibling sshpass rule, which is deliberately case-sensitive with the comment "Case matters here: -P is sshpass's prompt".

Suggested fix

Drop i from the mysql rule (/gi → /g), matching the sshpass rule's convention:

  • mysql -h db -P3306 -phunter2 app → mysql -h db -P3306 -p[REDACTED] app
  • lowercase -p3306 (attached password form) is still redacted
  • mysqldump -phunter2 db unchanged

Tests worth pinning: the mixed -P/-p command above, the lowercase attached form, and mysql -p database (space form = interactive prompt, database name must not be redacted).

Context: we hit this in a downstream deployment while extending coverage for SSHPASS=… sshpass -e and docker <global-options> login -p …; the case-sensitivity divergence was found by a full-scope review pass. Happy to send a PR if wanted.

Vorherrschende Sprache
TypeScript
Sterne
6.6k
Forks
914
Ø Merge
23 Std. 27 Min.
Gemergte PRs (30 T.)
136

Entwicklungsumgebung

  • Enthält ein Dockerfile oder eine Docker-Compose-Datei
  • Hat eine Pull-Request-Vorlage
  • Kein Beitragsleitfaden

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 CopilotKit/OpenBot

Alle Issues in CopilotKit/OpenBot

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

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