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

target host whitelist #354

Closed
wants to merge 8 commits into from
Closed

target host whitelist #354

wants to merge 8 commits into from

Conversation

djpnewton
Copy link

No description provided.

@djpnewton
Copy link
Author

oops

@djpnewton djpnewton closed this May 6, 2021
@coveralls
Copy link

Coverage Status

Coverage decreased (-1.2%) to 98.765% when pulling 62a3cc7 on zap-me:caprover into 02f0cbd on Rob--W:master.

Copy link
Owner

@Rob--W Rob--W left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some feedback in case you use it.

@@ -371,6 +372,13 @@ function getHandler(options, proxy) {
return;
}

var targetHost = location.host;
if (corsAnywhere.targetHostWhitelist.length && corsAnywhere.targetHostWhitelist.indexOf(targetHost) === -1) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This logic belongs to proxyRequest, otherwise a redirect can be abused to bypass this.

Alternatively, disable following of redirects.

@@ -23,7 +24,8 @@ var cors_proxy = require('./lib/cors-anywhere');
cors_proxy.createServer({
originBlacklist: originBlacklist,
originWhitelist: originWhitelist,
requireHeader: ['origin', 'x-requested-with'],
targetHostWhitelist: targetHostWhitelist,
requireHeader: [],//['origin', 'x-requested-with'],
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't disable requireHeader: ['origin', 'x-requested-with'],. That's a security issue.

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.

None yet

3 participants