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

Bearer Token Value Logged to Standard Output

Aperta Adatta ai principianti
#85 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
70/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Tranquilla
Stack tecnologico
python
Ambito
backend, security

Direzione di ricerca

Inizia in src/asfquart/session.py alle righe 73 e 88 e segui il percorso no-token_handler che gestisce l’header Authorization: Bearer. Verifica che nessun valore del token raggiunga lo standard output e che un avviso ometta il token. Aggiungi o aggiorna un unit test che copra questo percorso, quindi conferma i criteri di accettazione, inclusa la considerazione del no-op handler.

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

Descrizione

ASVS priority

Issue: FINDING-038 - Bearer Token Value Logged to Standard Output

Labels: bug, security, priority:high, asvs-level:L1

ASVS Level(s): [L1]

Description:

Summary

The ASFQuart session handler contains a debug print statement that outputs the full Bearer token value to stdout when no token_handler is registered. This constitutes a direct violation of ASVS 7.2.2's requirement to avoid storing sensitive session tokens in logs. The vulnerable code prints the raw token value from Authorization: Bearer header to stdout, which persists in server log files, enabling potential replay attacks if logs are accessed. However, this is currently a dead code path as ATR registers JWT verification as the token handler in production, so the else branch is never executed.

Details

Affected Files and Lines:

  • src/asfquart/session.py:73 - Debug print with token value
  • src/asfquart/session.py:88 - Debug print with token value

This appears to be debug code that was never removed. While currently unreachable in production, it represents a latent vulnerability.

Recommended Remediation

Remove token value from log statement:

# Replace:
print(f"Bearer {bearer}")

# With:
log.warning('Bearer token presented but no handler registered')

Alternative: Register a no-op token handler during application setup to prevent the debug path from executing:

# In atr/server.py after app = ASFQuart(__name__)
async def _noop_token_handler(token: str):
    return None

app.token_handler = _noop_token_handler
Acceptance Criteria
  • Token value removed from log statement
  • Warning logged without token value
  • No-op handler considered
  • Debug code path eliminated
  • Unit test verifying the fix
References
  • Source reports: L1:7.2.1.md, L1:7.2.2.md
  • Related findings: None
  • ASVS sections: 7.2.1, 7.2.2
Priority

High

Lingua principale
Python
Stelle
7
Fork
13
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

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 apache/infrastructure-asfquart

Tutte le issue di apache/infrastructure-asfquart

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.