Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

BUG: regex, package-hallucination and aggregator scorer identities collide across configs

Aperta
#3,113 1 commento 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

@richlundeen ci sta già lavorando.

Dal 10/10/2026.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
security

Direzione di ricerca

Start with RegexScorer._build_identifier and the _ConfigurableRegexScorerMixin scorers (XSS, SQLi, SSRF, MarkdownInjection), then compare with CredentialLeakScorer, which already hashes its patterns. Also check PackageHallucinationScorer and the FloatScaleScorerByCategory and FloatScaleScorerAllCategories aggregators, whose __name__ values collide. Reproduce the four collision cases in the issue before changing anything. Done means distinct identifiers for differently configured scorers, default-config hashes unchanged, and a maintainer decision on the metrics registry.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Some scorer identifiers leave out the config that decides the result, so differently configured scorers share a hash and eval_hash. That means get_scorer_metrics() and the evaluator's skip-if-exists can return another config's metrics, and stored scores can't be told apart.

  • RegexScorer._build_identifier only records pattern_count, so any two RegexScorers with the same number of patterns collide. Same for the _ConfigurableRegexScorerMixin scorers (XSS, SQLi, SSRF, MarkdownInjection) with custom patterns. CredentialLeakScorer already hashes its patterns, so it's just the base that's missing it.
  • PackageHallucinationScorer only records known_package_count.
  • FloatScaleScorerByCategory.MAX and FloatScaleScorerAllCategories.MAX both have __name__ MAX_by_category_ (same for MIN/AVERAGE), and scorers record aggregator.__name__. One returns one score per category (and makes FloatScaleThresholdScorer raise), the other returns one score.
RegexScorer A vs B (1 pattern each, different patterns): same hash True, same eval_hash True; A -> false, B -> true
Markdown default vs custom patterns: same eval_hash True
PackageHallucination {requests} vs {evilpkg}: eval_hash equal True
aggregator names: MAX_by_category_ MAX_by_category_ -> same eval_hash True

A fix would add a pattern/package digest (only when it differs from the defaults, so stored default hashes stay put) and give the all-categories aggregators their own names. Since this moves some hashes, filing first to check how you want the metrics registry handled.

Lingua principale
Python
Stelle
4.6k
Fork
944
Merge medio
2g 23h
PR unite (30g)
285

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di microsoft/PyRIT

Tutte le issue di microsoft/PyRIT

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.