CVE-2026-123870
Unauthenticated eval() via missing webhook secret leads to RCE
- CVSS 9.5
- CWE-95
- Authentication, Authorization, and Session Management
- Remote
The otterdog webapp evaluates a format-string built from the incoming GitHub webhook JSON body using Python's eval(). When the GITHUB_WEBHOOK_SECRET configuration value is unset or empty (the code default is None), the HMAC signature check is skipped entirely, allowing an unauthenticated network client to reach the eval() sink with attacker-controlled input and execute arbitrary Python on the webapp host.
- CWE
- CWE-95
- CVSS base score
- 9.5
- Published
- 2026-11-09
- OWASP
- A03 Injection
- Orthogonal defect classification
- Checking
- Code defect classification
- Missing Check
- Category
- Authentication, Authorization, and Session Management
- Subcategory
- Insecure Authentication Mechanisms
- Accessibility scope
- Remote
- Impact
- Arbitrary Code Execution
- Affected component
- Python
Solution
Upgrade otterdog to v2.3.1 or later, which removes the unsafe eval() and enforces mandatory GITHUB_WEBHOOK_SECRET verification.
Vulnerable code sample
import hmac
import json
from flask import Flask, request, abort
app = Flask(__name__)
app.config['GITHUB_WEBHOOK_SECRET'] = None # could be set to a secret string
def verify_signature(payload: bytes, signature: str, secret: str) -> bool:
mac = hmac.new(secret.encode(), payload, digestmod='sha256')
expected = 'sha256=' + mac.hexdigest()
return hmac.compare_digest(expected, signature)
@app.route('/github-webhook', methods=['POST'])
def github_webhook():
payload = request.get_data()
signature = request.headers.get('X-Hub-Signature-256', '')
secret = app.config.get('GITHUB_WEBHOOK_SECRET')
if secret:
if not verify_signature(payload, signature, secret):
abort(403)
# VULNERABLE: eval of attacker‑controlled format string
data = json.loads(payload)
fmt = data.get('format')
result = eval(f"f'{fmt}'")
return {'result': result}Patched code sample
import hmac
import json
import ast
from flask import Flask, request, abort
app = Flask(__name__)
app.config['GITHUB_WEBHOOK_SECRET'] = None # could be set to a secret string
def verify_signature(payload: bytes, signature: str, secret: str) -> bool:
mac = hmac.new(secret.encode(), payload, digestmod='sha256')
expected = 'sha256=' + mac.hexdigest()
return hmac.compare_digest(expected, signature)
@app.route('/github-webhook', methods=['POST'])
def github_webhook():
payload = request.get_data()
signature = request.headers.get('X-Hub-Signature-256', '')
secret = app.config.get('GITHUB_WEBHOOK_SECRET')
if secret:
if not verify_signature(payload, signature, secret):
abort(403)
else:
abort(401) # FIX: enforce authentication when secret is missing
data = json.loads(payload)
fmt = data.get('format')
# FIX: use safe literal evaluation instead of eval
result = ast.literal_eval(f"'{fmt}'")
return {'result': result}Published fix
Public sources link this CVE to the changes below. The code samples above were generated to illustrate the defect; these links lead to the code the project actually changed.
- Use callables for webhook event filters and require webhook (eclipse-csi/otterdog)
otterdog/webapp/webhook/github_webhook.py,otterdog/webapp/webhook/github_webhook.py · GitHubWebhook.init_app,otterdog/webapp/webhook/github_webhook.py · GitHubWebhook._get_digest,otterdog/webapp/webhook/github_webhook.py · GitHubWebhook._post_receive,otterdog/webapp/webhook/github_webhook.py · _log_event
Cite this entry
@misc{vaitp:cve2026123870,
title = {{Unauthenticated eval() via missing webhook secret leads to RCE}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-123870},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-123870/}}
}
Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.
The supreme art of war is to subdue the enemy without fighting.
Sun Tzu – “The Art of War”
:: Shaping the future through research and ingenuity ::
