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

Open Redirect Vulnerability Mitigation - CWE 601 #1963

Merged
merged 2 commits into from
May 29, 2020

Conversation

daneallen
Copy link
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 <daniel.allen@friends.dds.mil>
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