Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add interception route check #38

Merged
merged 1 commit into from
Jan 14, 2025

Conversation

zhongliang02
Copy link
Contributor

@zhongliang02 zhongliang02 commented Jan 13, 2025

Context

In a recent VAPT on care360, it was discovered that an open redirect is still possible by using an undocumented feature (interception routes interpolation) (issue labelled as GTA-55-008).

Approach

In this version bump, I have ported the check for interception routes into the validation logic.
This should block the the undocumented feature.
In the next version bump, a strict character whitelist will be enforced by default, with an option to override it.

Risk

This will break existing routes that contain (.) or (..) or (...) or (..)(..).

Testing

The fix can be verified simply by visiting the links below and checking if the open redirect can still be triggered.

Email: any@open.gov.sg
OTP: 123123

[v1.2.10 open redirect poc] [deploy src]
[v1.2.11 poc no longer works] [deploy src]

VAPT vendor says [link]

most likely resolves the issue. At least for the most recent Next.js versions. There might be older versions where the fix doesn't work.

@zhongliang02 zhongliang02 requested a review from a team January 14, 2025 04:30
@zhongliang02 zhongliang02 marked this pull request as ready for review January 14, 2025 23:10
@zhongliang02 zhongliang02 merged commit 56f5d3a into develop Jan 14, 2025
6 checks passed
@zhongliang02 zhongliang02 deleted the fix/add-interception-route-check branch January 15, 2025 09:57
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.

2 participants