Skip to content

Open Redirect Vulnerability Mitigation - CWE 601 - #1963

Merged
NGPixel merged 2 commits into
requarks:masterfrom
daneallen:master
May 29, 2020
Merged

NGPixel merged 2 commits into
requarks:masterfrom
daneallen:master

Conversation

@daneallen

Copy link
Copy Markdown
Contributor

Refactored Open Redirect vulnerability to allow for user configuration as requested.

Prior it was observed that the req.url could get parsed to navigate a user to an external website, example: https://docs.requarks.io////google.com// would navigate directly to google.com. This behavior was observed in the req.url variable. This PR allows a configurable middleware to strip all repeating / characters from the user controlled url. More about the vulnerability can be found at
https://cwe.mitre.org/data/definitions/601.html

In addition, it was observed that ./server/middlewares/secruity.js if statements were not referencing global variables correctly as per the ./server/app/data.yml file structure. As such they were effectively being ignored as confirmed by console.log statements. The data.yml format required the variables to be referenced as WIKI.config.security.* to be effective. This PR simultaneously fixes that issue.

@auto-assign
auto-assign Bot requested a review from NGPixel May 29, 2020 22:01
@NGPixel
NGPixel merged commit 20e6bc1 into requarks:master May 29, 2020
jionggyu pushed a commit to jionggyu/wiki-2.5.302-patch that referenced this pull request Jul 9, 2024
* Open redirect vulnerabilty mitigation

* Refacted Open Redirect to user configurable and corrected incorrect security variable names.

Co-authored-by: danallendds <[email protected]>
rainforwind pushed a commit to rainforwind/wikijs that referenced this pull request Aug 30, 2026
* Open redirect vulnerabilty mitigation

* Refacted Open Redirect to user configurable and corrected incorrect security variable names.

Co-authored-by: danallendds <[email protected]>
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