zendframework / zend-http

Http component from Zend Framework
BSD 3-Clause "New" or "Revised" License
134 stars 85 forks source link

Invalid header results in infinite recursion #180

Closed TamaraGunkel closed 4 years ago

TamaraGunkel commented 5 years ago

Hey, I'm using Zend Framework 3 in one of my projects and I'm encountering an issue during redirection. I wanted to pass a query parameter that includes \r and \n. However, the server stops responding because Zend enters an infinite recursion loop in this line.

To avoid this issue, I'm URL encoding the query parameter.

Code to reproduce the issue

(in some Controller)

 return $this->redirect()
                ->toUrl('/mail-campaign/edit?testMailSent=false&message=test \r \n test');

Expected results

Zend should throw an error if the header is invalid.

Actual results

Zend is entering infinite loop.