opencrvs / opencrvs-core

A global solution to civil registration
https://www.opencrvs.org
Other
85 stars 67 forks source link

R03 Do not transfer JWT token as a URL parameter on login #7500

Open rikukissa opened 3 weeks ago

rikukissa commented 3 weeks ago

Description

Security assessment details

Technical Overview

The application included the JSON Web Token (JWT) in the URL. Sensitive information within URLs may be logged in various locations, including the user's browser, the web server, and any forward or reverse proxy servers between the two endpoints. URLs may also be displayed on-screen, bookmarked or emailed around by users. They may be disclosed to third parties via the Referer header when any off-site links are followed. Placing such information into the URL increases the risk that an attacker will capture them.

Potential Impact if Exploited

A successful attack could allow an attacker to gain access to the environment as an authorised user.

Recommendations

The application should only transmit sensitive information following a successful POST request, and avoid including it in places that may be stored by the browser for extended periods, or places that may be visible to people other than the user.

Acceptance criteria

GIVEN WHEN THEN

Design

(Link to Figma)

Dev tasks

rikukissa commented 2 weeks ago

Just a note for myself – full OAuth2 implementation is probably where we are headed in the long term given that:

https://auth0.com/docs/get-started/authentication-and-authorization-flow/authorization-code-flow-with-pkce