Skip to content

Commit 62b192c

Browse files
carlospolopgitbook-bot
authored andcommitted
GITBOOK-4336: No subject
1 parent 0c8c5b0 commit 62b192c

File tree

1 file changed

+14
-0
lines changed
  • network-services-pentesting/pentesting-web/php-tricks-esp

1 file changed

+14
-0
lines changed

network-services-pentesting/pentesting-web/php-tricks-esp/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,20 @@ True
210210

211211
### HTTP headers bypass abusing PHP errors
212212

213+
#### Causing error after setting headers
214+
215+
From [**this twitter thread**](https://twitter.com/pilvar222/status/1784618120902005070?t=xYn7KdyIvnNOlkVaGbgL6A\&s=19) you can see that sending more than 1000 GET params or 1000 POST params or 20 files, PHOP is not going to be setting headers in the response.
216+
217+
Allowing to bypass for example CSP headers being set in codes like:
218+
219+
```php
220+
<?php
221+
header("Content-Security-Policy: default-src 'none';");
222+
if (isset($_GET["xss"])) echo $_GET["xss"];
223+
```
224+
225+
#### Filling a body before setting headers
226+
213227
If a **PHP page is printing errors and echoing back some input provided by the user**, the user can make the PHP server print back some **content long enough** so when it tries to **add the headers** into the response the server will throw and error.\
214228
In the following scenario the **attacker made the server throw some big errors**, and as you can see in the screen when php tried to **modify the header information, it couldn't** (so for example the CSP header wasn't sent to the user):
215229

0 commit comments

Comments
 (0)