Skip to content

fix(api): secure exception handling and prevent information disclosure#1106

Open
RinZ27 wants to merge 1 commit intolangflow-ai:mainfrom
RinZ27:fix/api-exception-handling
Open

fix(api): secure exception handling and prevent information disclosure#1106
RinZ27 wants to merge 1 commit intolangflow-ai:mainfrom
RinZ27:fix/api-exception-handling

Conversation

@RinZ27
Copy link

@RinZ27 RinZ27 commented Mar 12, 2026

Error handling in OAuth and chat endpoints was returning raw exception messages to clients, which could lead to sensitive information disclosure about the system's internal structure or environment.

Replacing these raw responses with generic, user-friendly error messages ensures the API remains robust and secure. Full tracebacks are now correctly routed to the server logs via the existing logger for debugging purposes, while the client only sees a high-level error state.

All security-sensitive paths in src/api/auth.py, src/api/chat.py, src/api/connectors.py, and src/api/documents.py have been updated to follow this pattern. This approach prevents potential attackers from gaining insights into the application's underlying logic or configuration through error strings.

Verified the changes locally. All API endpoints now return sanitized JSON responses on failure.

@github-actions github-actions bot added backend 🔷 Issues related to backend services (OpenSearch, Langflow, APIs) community bug 🔴 Something isn't working. labels Mar 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend 🔷 Issues related to backend services (OpenSearch, Langflow, APIs) bug 🔴 Something isn't working. community

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant