-
-
Notifications
You must be signed in to change notification settings - Fork 326
Description
Summary
Multiple API endpoints are returning raw exception messages (str(e)) in JSON responses, which can leak internal system information. While not exposing credentials directly, this violates security best practices and can aid attackers in reconnaissance.
Problem
Exception messages in API responses can reveal:
- Internal service URLs (e.g.,
ORD_SERVER_URLendpoints in network errors) - Library versions and dependencies (if present in error messages)
- System architecture hints (service names, internal paths)
- Implementation details (error handling patterns, validation logic)
Note: This does NOT expose API keys, passwords, or credentials directly. However, it's still an information disclosure issue that should be addressed as a defense-in-depth measure.
Affected Endpoints
website/views/repo.py (7 instances)
- Lines 257, 275: AI summary generation errors
- Line 297: Section refresh operation errors
- Line 445: GitHub API error handling
- Line 565: Repository add operation errors
- Lines 629, 647: Command execution errors (also exposes
error_typefield)
website/views/bitcoin.py (1 instance)
- Line 89: RequestException in pending transactions view (could expose
ORD_SERVER_URL)
website/views/core.py (2 instances)
- Lines 1552, 1554: Roadmap PR submission errors
website/views/organization.py (2 instances)
- Lines 2881, 2884: Message creation stream errors
Example
Current behavior:
{
"status": "error",
"message": "Connection refused: http://internal-service:9001/send-bacon-tokens"
}What this reveals:
- Internal service endpoint URL
- Service port number
- Service name/functionality
Recommended behavior:
{
"status": "error",
"message": "An error occurred while processing your request. Please try again later."
}## Recommended Fix
- Log full exception details server-side with
logger.error(..., exc_info=True) - Return generic, user-friendly error messages to clients
- Remove
error_typefield from error responses (lines 629, 647 in repo.py)
Impact
- Severity: Low-Medium (Information Disclosure)
- CVSS: ~3.1 (Low) - Information Exposure
- Priority: Best Practice / Defense-in-Depth
- Exploitability: Low (requires error conditions to trigger)
Additional Improvements Included
- Fix TransactionManagementError logging in
blt/middleware/ip_restrict.py(change from debug to warning level) - Make CVE query prefix case-insensitive in
website/views/issue.pyfor better UX
Metadata
Metadata
Assignees
Labels
Type
Projects
Status