Skip to content

Commit

Permalink
url-parsing: reject CRLFs within URLs
Browse files Browse the repository at this point in the history
Bug: http://curl.haxx.se/docs/adv_20150108B.html
Reported-by: Andrey Labunets
  • Loading branch information
bagder committed Jan 7, 2015
1 parent f7d5ece commit 178bd7d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/url.c
Expand Up @@ -3842,6 +3842,13 @@ static CURLcode parseurlandfillconn(struct SessionHandle *data,

*prot_missing = FALSE;

/* We might pass the entire URL into the request so we need to make sure
* there are no bad characters in there.*/
if(strpbrk(data->change.url, "\r\n")) {
failf(data, "Illegal characters found in URL");
return CURLE_URL_MALFORMAT;
}

/*************************************************************
* Parse the URL.
*
Expand Down

0 comments on commit 178bd7d

Please sign in to comment.