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

URL in config files can specify request method #2431

Open
Blaisorblade opened this issue Aug 3, 2016 · 4 comments
Open

URL in config files can specify request method #2431

Blaisorblade opened this issue Aug 3, 2016 · 4 comments

Comments

@Blaisorblade
Copy link
Collaborator

While reviewing #2412, I double-checked that the URL-parser parseRequest in FromJSON PackageLocation did the right thing. But it seems it doesn't quite do that. It allows specifying a method: parseRequest "POST http://httpbin.org/post" [1].
Potentially worse, I can ship somebody a stack.yaml that will trigger POST requests upon install. I don't see how to actually exploit this, but someone might. Switching to another URI parser should prevent this, and should be easy since the parsed URI is thrown away. One should probably also review the parsing that is used to actually access the URI though.

[1] https://hackage.haskell.org/package/http-client-0.5.0/docs/Network-HTTP-Client.html#v:parseRequest

[2] http://hackage.haskell.org/package/network-uri-2.6.1.0/docs/Network-URI.html#v:parseURI

@mgsloan
Copy link
Contributor

mgsloan commented Aug 3, 2016

Certainly seems like something worth addressing. I don't see how to exploit it either, since this isn't a browser POST, there are no cookies.

@borsboom
Copy link
Contributor

borsboom commented Aug 4, 2016

There are a lot of ways that building Haskell code is insecure. For example, TemplateHaskell code can basically issue any HTTP request it wants to (or do anything else on your system), so security issues in stack.yaml, while unfortunate, probably don't make much difference to overall security.

@mgsloan
Copy link
Contributor

mgsloan commented Aug 4, 2016

Indeed, so we could possibly leave this in as just a somewhat odd feature.

@Blaisorblade Blaisorblade modified the milestones: P3: Optional, P2: Should Aug 4, 2016
@sjakobi
Copy link
Member

sjakobi commented Aug 9, 2016

Somewhat related: my thoughts on using a custom URL type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants