▲ | 0xbadcafebee a day ago | |||||||||||||||||||||||||||||||
Worth noting that people here are assuming that the author's assumption is correct, that his writing /etc/hosts is causing the 403, and that this is either a consequence of security filtering, or that this combination of characters at all that's causing the failure. The only evidence he has, is he gets back a 403 forbidden to an API request when he writes certain content. There's a thousand different things that could be triggering that 403. It's not likely to be a WAF or content scanner, because the HTTP request is using PUT (which browser forms don't use) and it's uploading the content as a JSON content-type in a JSON document. The WAF would have to specifically look for PUTs, open up the JSON document, parse it, find the sub-string in a valid string, and reject it. OR it would have to filter raw characters regardless of the HTTP operation. Neither of those seem likely. WAFs are designed to filter on specific kinds of requests, content, and methods. A valid string in a valid JSON document uploaded by JavaScript using a JSON content-type is not an attack vector. And this problem is definitely not path traversal protection, because that is only triggered when the string is in the URL, not some random part of the content body. | ||||||||||||||||||||||||||||||||
▲ | apetresc a day ago | parent | next [-] | |||||||||||||||||||||||||||||||
It sure looks like the author did his due diligence; he has a chart of all the different phrases in the payload which triggered the 403 and they all corresponded to paths to common UNIX system configuration files. Nobody could prove that's exactly what's happening without seeing Cloudflare's internal WAF rules, but can you think of any other reasonable explanation? The endpoint is rejecting a PUT who's payload contains exactly /etc/hosts, /etc/passwd, or /etc/ssh/sshd_config, but NOT /etc/password, /etc/ssh, or /etc/h0sts. What else could it be? | ||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||
▲ | ryandrake a day ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||
If you change a single string in the HTTP payload and it works, what other explanation makes sense besides a text scanner somewhere along the path to deploying the content? | ||||||||||||||||||||||||||||||||
▲ | Null-Set a day ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||
See https://developers.cloudflare.com/waf/change-log/2025-04-22/ rule 100741. It references this CVE https://github.com/tuo4n8/CVE-2023-22047 which allows the reading of system files. The example given shows them reading /etc/passwd | ||||||||||||||||||||||||||||||||
▲ | SonOfLilit a day ago | parent | prev [-] | |||||||||||||||||||||||||||||||
You're being downvoted because WAFs work exactly like this, and it's intentional and their vendors think this is a good thing. A WAF vendor would say that a WAF parsing JSON makes it weaker. | ||||||||||||||||||||||||||||||||
|