π‘οΈ Sentinel: [HIGH] Fix error disclosure and enforce JWT secret - #28
Conversation
- Remove 'details': str(e) from login_required to prevent leaking exception details to unauthenticated callers. - Require JWT_SECRET_KEY environment variable in JWTUtils rather than falling back to a hardcoded default secret. - Update deprecated datetime.utcnow() usages to datetime.now(timezone.utc). - Add unit tests in tests/test_auth_utils.py. Co-authored-by: Pmaster-dev <293764797+Pmaster-dev@users.noreply.github.com>
|
π Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a π emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
π‘οΈ Sentinel: Fix error disclosure and hardcoded JWT fallback secret
π¨ Severity: HIGH
π‘ Vulnerability:
login_requireddecorator returneddetails: str(e)in 401 Unauthorized responses, exposing internal exception strings and stack traces to unauthenticated callers.JWTUtilsdefaulted to an insecure hardcoded secret ('jwt-secret') whenJWT_SECRET_KEYenvironment variable was omitted.π― Impact:
JWT_SECRET_KEY.π§ Fix:
details: str(e)fromlogin_requirederror response.JWT_SECRET_KEYinJWTUtils, throwing an error or failing gracefully if missing instead of using a fallback.tests/test_auth_utils.pyto verify no error details are leaked andJWTUtilsenvironment variable constraints are enforced.β Verification:
tests/test_auth_utils.pypass.PR created automatically by Jules for task 16330162437952022102 started by @Pmaster-dev