2023-09-25 12:31:17 +02:00
|
|
|
include::../../../shared_content/secrets/description.adoc[]
|
|
|
|
|
|
|
|
== Why is this an issue?
|
|
|
|
|
|
|
|
include::../../../shared_content/secrets/rationale.adoc[]
|
|
|
|
|
|
|
|
=== What is the potential impact?
|
|
|
|
|
|
|
|
If a JWT secret key leaks to an unintended audience, it can have serious
|
|
|
|
security implications for the corresponding application. The secret key is used
|
|
|
|
to encode and decode JWTs when using a symmetric signing algorithm, and an
|
|
|
|
attacker could potentially use it to perform malicious actions.
|
|
|
|
|
|
|
|
For example, an attacker could use the secret key to create their own
|
|
|
|
authentication tokens that appear to be legitimate, allowing them to bypass
|
|
|
|
authentication and gain access to sensitive data or functionality.
|
|
|
|
|
|
|
|
In the worst-case scenario, an attacker could be able to execute arbitrary code
|
|
|
|
on the application by abusing administrative features, and take over its hosting
|
|
|
|
server.
|
|
|
|
|
2024-03-08 09:08:14 +01:00
|
|
|
// How to fix it section
|
2023-09-25 12:31:17 +02:00
|
|
|
|
2024-03-08 09:08:14 +01:00
|
|
|
include::how-to-fix-it/flask.adoc[]
|
2023-09-25 12:31:17 +02:00
|
|
|
|
2024-03-08 09:08:14 +01:00
|
|
|
include::how-to-fix-it/python-jose.adoc[]
|
2023-09-25 12:31:17 +02:00
|
|
|
|
2024-03-08 09:08:14 +01:00
|
|
|
include::how-to-fix-it/pyjwt.adoc[]
|
2023-09-25 12:31:17 +02:00
|
|
|
|
2024-03-08 09:08:14 +01:00
|
|
|
include::how-to-fix-it/django.adoc[]
|
2023-09-25 12:31:17 +02:00
|
|
|
|
|
|
|
== Resources
|
|
|
|
|
|
|
|
include::../../../shared_content/secrets/resources/standards.adoc[]
|
|
|
|
|
|
|
|
=== Documentation
|
|
|
|
|
|
|
|
* Flask JWT documentation - https://flask-jwt-extended.readthedocs.io/en/stable/options.html#jwt-secret-key[Config - JWT_SECRET_KEY]
|
2024-03-08 09:08:14 +01:00
|
|
|
* Python-Jose documentation - https://python-jose.readthedocs.io/en/latest/jwt/index.html[JSON Web Token]
|
|
|
|
* PyJWT documentation - https://pyjwt.readthedocs.io/en/stable/api.html[API Reference]
|
|
|
|
* Simple JWT documentation - https://django-rest-framework-simplejwt.readthedocs.io/en/latest/settings.html#signing-key[SIGNING_KEY]
|
2023-09-25 12:31:17 +02:00
|
|
|
|
|
|
|
//=== Benchmarks
|