Skip to content

Conversation

jamesjefferies
Copy link

@jamesjefferies jamesjefferies commented Sep 11, 2025

The 404 processing ends up redirecting a request with multiple path slashes to that site, i.e.

https://my-site//shedcode.co.uk will redirect to https://shedcode.co.uk

Identified in issue #2429

This commit uses a regular expression and a substitution to remove the multiple leading slashes before redirecting.


📚 Documentation preview 📚: https://datasette--2500.org.readthedocs.build/en/2500/

The 404 processing ends up redirecting a request with multiple path
slashes to that site, i.e.

https://my-site//shedcode.co.uk will redirect to https://shedcode.co.uk

This commit uses a regular expression to remove the multiple leading
slashes before redirecting.
@jamesjefferies jamesjefferies changed the title Fix for open redirect - identified in Issue 2429 - NOTE - no tests yet Fix for open redirect - identified in Issue 2429 Sep 11, 2025
@jamesjefferies jamesjefferies marked this pull request as ready for review September 11, 2025 21:17
@simonw
Copy link
Owner

simonw commented Sep 12, 2025

Ouch! Thanks for the report. I'll look at this today.

@jamesjefferies
Copy link
Author

Have you had chance to have a look yet @simonw ?

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