Skip to content

Potential fix for code scanning alert no. 92: Information exposure through an exception - #180

Merged
0x5t4l1n merged 1 commit into
mainfrom
alert-autofix-92
Jul 29, 2026
Merged

Potential fix for code scanning alert no. 92: Information exposure through an exception#180
0x5t4l1n merged 1 commit into
mainfrom
alert-autofix-92

Conversation

@0x5t4l1n

Copy link
Copy Markdown
Member

Potential fix for https://github.com/th30d4y/OpenLearnX/security/code-scanning/92

To fix this without changing functionality, keep the 500 behavior and success schema but replace user-facing exception details with a generic message. Log the detailed exception only on the server.

Best change in backend/routes/quizzes.py:

  • In generate_ai_quiz() except block, replace:
    • return jsonify({"success": False, "error": str(e)}), 500
      with:
    • return jsonify({"success": False, "error": "An internal error has occurred."}), 500
  • Apply the same change in generate_ai_questions() to avoid the same issue there.
  • Keep existing print(...) logging as-is (it preserves diagnostics server-side).

No new imports or dependencies are required.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

…rough an exception

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

👋 Hello! Thanks for your contribution. We will review this and get back to you as soon as possible. — th30d4y

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Message that will be displayed on users' first pull request

@0x5t4l1n
0x5t4l1n marked this pull request as ready for review July 29, 2026 18:30
@0x5t4l1n 0x5t4l1n self-assigned this Jul 29, 2026
@0x5t4l1n
0x5t4l1n merged commit a82450c into main Jul 29, 2026
10 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant