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

Detect CRLF URL attempts and fight back with an attempted humor #273

Merged
merged 2 commits into from
Feb 6, 2024

Conversation

spaze
Copy link
Owner

@spaze spaze commented Feb 6, 2024

URLs like /%0DSet-Cookie:... would throw

PHP Warning: Header may not contain more than a single header, new line detected in [...]Http/Response.php:98

because of the IResponse::redirect() call in WebApplication::redirectToSecure():

$this->httpResponse->redirect($url->getAbsoluteUrl(), IResponse::S301_MovedPermanently);

Let's detect such attempts and stop them in their tracks.

The cookie expired timestamp has been later changed in 0a8a273 #296

spaze added 2 commits February 6, 2024 02:19
URLs like `/%0DSet-Cookie:...` would throw "PHP Warning: Header may not contain more than a single header, new line detected in [...]Http/Response.php:98" because of the `IResponse::redirect()` call in `WebApplication::redirectToSecure()`. Let's detect such attempts and stop them in their tracks.
@spaze spaze self-assigned this Feb 6, 2024
@spaze spaze merged commit de52d3a into main Feb 6, 2024
32 checks passed
@spaze spaze deleted the spaze/new-line-injections branch February 6, 2024 01:43
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.

1 participant