Skip to content
This repository has been archived by the owner on Feb 7, 2021. It is now read-only.

[master] Send CORS headers to allow cross site requests #129

Closed

Conversation

brandonwamboldt
Copy link
Contributor

This PR adds CORS headers to all responses so that HTML tools (e.g. dashboards) can be built that don't need to be served from the same domain as Varnish Agent, which is very useful in situations with multiple varnish servers or if you want to host your tools with something like Nginx/Apache (so you have access to FastCGI languages for example).

This will allow cross-site HTTP requests from ANY domain, which normally would be a security risk in an application like this where you have destructive capabilities. However, Varnish Agent forces you to use HTTP basic authentication, so that risk is mitigated. An attacker can only perform a cross-site request if they know the host, port, username, and password for varnish agent, at which point you have larger issues.

There is no way from the browser sandbox for a script to send a request without hard coding the credentials into the JavaScript, unless it's on the same domain (in which case this PR changes nothing).

I'm happy to answer any questions about this.

@brandonwamboldt brandonwamboldt changed the title Send CORS headers to allow cross site requests [master] Send CORS headers to allow cross site requests Feb 23, 2015
@fgsch
Copy link
Contributor

fgsch commented Mar 11, 2015

Thanks for the PR!

I've merged it with some minor changes.

@fgsch fgsch closed this Mar 11, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants