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

Regular expression in scrub produces incorrect results if URL path portion contains a bare '@' #30

Closed
carlosduclos opened this issue Mar 17, 2017 · 1 comment

Comments

@carlosduclos
Copy link
Contributor

Original issue

browndav
In https://github.com/dscape/nano/blob/master/lib/nano.js#L64, (.)@ is being used instead of the non-greedy (.?)@ or ([^@]*)@ – this matches up until the last occurrence of @, rather than the first. If the URL's path component contains a bare @, the entire hostname and a portion of the path could be stripped. For example, scrub('https://foo:bar@host/foo/bar/@quux') will yield "https://XXXXXX:XXXXXX@quux" instead of "https://XXXXXX:XXXXXX@host/foo/bar/@quux".

I can't see any way to exploit this beyond potentially hiding URL contents in logs, but admittedly haven't investigated closely.

@big-r81
Copy link
Contributor

big-r81 commented Jun 20, 2022

I'm closing this old ticket. If it's still a problem, please reopen or create a new ticket.

@big-r81 big-r81 closed this as completed Jun 20, 2022
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

No branches or pull requests

2 participants