You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by carlosduclos <gi...@git.apache.org> on 2017/03/17 14:05:06 UTC

[GitHub] couchdb-nano issue #30: Regular expression in `scrub` produces incorrect res...

GitHub user carlosduclos opened an issue:

    https://github.com/apache/couchdb-nano/issues/30

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

    [Original issue](https://github.com/dscape/nano/issues/334)
    
    __browndav__
    In https://github.com/dscape/nano/blob/master/lib/nano.js#L64, (.*)@ is being used instead of the non-greedy (.*?)@ or ([^@]*)@ \u2013 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.

----

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---