Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Bearer Token Value Logged to Standard Output

オープン 初心者向け
#85 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
70/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
静か
技術スタック
python
領域
backend, security

調査の方向性

src/asfquart/session.py の 73 行目と 88 行目から始め、Authorization: Bearer ヘッダーを処理する no-token_handler パスを追跡します。トークン値が標準出力に到達しないこと、および警告にトークンが含まれないことを確認します。このパスをカバーする unit test を追加または更新し、その後、no-op handler の考慮を含む受け入れ基準を確認します。

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
Python
スター
7
フォーク
13
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apache/infrastructure-asfquart のほかの issue

apache/infrastructure-asfquart の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。