
CVE-2026-22005에 대한 개념 증명(PoC)으로, 너무 짧은 폴링 간격을 통한 OAuth 2.0 디바이스 코드 피싱을 보여주며, 취약한 Flask 서버와 토큰 탈취를 위한 익스플로잇 흐름을 포함합니다.
# device_code_server.py - Authorization server with too-fast polling
import time, secrets
codes = {}
@app.route('/device/code')
def device_code():
code = secrets.token_urlsafe(16)
codes[code] = {'user_code': secrets.token_hex(4), 'status': 'pending'}
return jsonify(codes[code])
@app.route('/token')
def token():
code = request.args['device_code']
# Vulnerability: allows polling every 1 second, and attacker can brute-force user_code
if codes[code]['status'] == 'pending':
# Check if user_code was entered (simulated)
time.sleep(0.5) # delay to simulate user
return jsonify({'access_token': 'secret'})
OAuth 2.0 디바이스 권한 부여(device authorization grant)를 통해 클라이언트는 토큰 엔드포인트를 매초 폴링할 수 있습니다. 공격자는 디바이스 플로우를 시작하고 사용자 코드를 피해자에게 표시(피싱)할 수 있으며, 폴링 간격이 매우 짧기 때문에 피해자가 악용 사실을 알아차리기 전에 액세스 토큰을 획득하게 됩니다.
시뮬레이션 실행:
pip install flask
python device_code_server.py
# Attacker starts flow, gets device_code and user_code, phishes victim.