Most active commenters

    ←back to thread

    603 points scalewithlee | 49 comments | | HN request time: 1.475s | source | bottom
    1. Y_Y ◴[] No.43793778[source]
    Does it block `/etc//hosts` or `/etc/./hosts`? This is a ridiculous kind of whack-a-mole that's doomed to failure. The people who wrote these should realize that hackers are smarter and more determined than they are and you should only rely on proven security, like not executing untrusted input.
    replies(6): >>43793862 #>>43793868 #>>43793954 #>>43794072 #>>43794473 #>>43802345 #
    2. mystifyingpoi ◴[] No.43793862[source]
    No one expects any WAF to be a 100% solution that catches all exfiltration attempts ever, and it should not be treated this way. But having it is generally better than not having it.
    replies(7): >>43793876 #>>43793969 #>>43794144 #>>43794428 #>>43795337 #>>43796158 #>>43796295 #
    3. jrockway ◴[] No.43793868[source]
    Yeah, and this seems like a common Fortune 500 mandatory checkbox. Gotta have a Web Application Firewall! Doesn't matter what the rules are, as long as there are a few. Once I was told I needed one to prevent SQL injection attacks... against an application that didn't use an SQL database.

    If you push back you'll always get a lecture on "defense in depth", and then they really look at you like you're crazy when you suggest that it's more effective to get up, tap your desk once, and spin around in a circle three times every Thursday morning. I don't know... I do this every Thursday and I've never been hacked. Defense in depth, right? It can't hurt...

    replies(3): >>43793920 #>>43795851 #>>43799653 #
    4. paxys ◴[] No.43793876[source]
    > But having it is generally better than not having it.

    So is HN and every other site in the world insecure because it allows users to post "/etc/hosts" ?

    replies(3): >>43793948 #>>43793953 #>>43794001 #
    5. bombcar ◴[] No.43793920[source]
    I love that having a web application firewall set to allow EVERYTHING passes the checkbox requirement ...
    replies(1): >>43794124 #
    6. mystifyingpoi ◴[] No.43793948{3}[source]
    Maybe? I don't know nor care. Assuming that HN has a vuln with path traversal, a sanely configured WAF would block the traversal attempt.
    replies(2): >>43793977 #>>43794135 #
    7. ◴[] No.43793953{3}[source]
    8. eli ◴[] No.43793954[source]
    Is a security solution worthless if it can't stop a dedicated attacker? A lot of WAF rules are blocking probes from off-the-shelf vulnerability scanners.
    replies(4): >>43794116 #>>43794355 #>>43795518 #>>43796747 #
    9. smallnix ◴[] No.43793969[source]
    Dropping 0.5% of requests will prevent even the most sophisticated attacks (think APT!). Sometimes.
    replies(1): >>43794512 #
    10. smallnix ◴[] No.43793977{4}[source]
    *some traversal attempts
    11. ◴[] No.43794001{3}[source]
    12. nickdothutton ◴[] No.43794072[source]
    See "enumerating badness" as a losing strategy. I knew this was a bad idea about 5 minutes after starting my first job in 1995.
    13. da_chicken ◴[] No.43794116[source]
    "It's technically better than nothing," is kind of a bizarre metric.

    It's like not allowing the filesystem to use the word "virus" in a file name. Yes, it technically protects against some viruses, but it's really not very difficult to avoid while being a significant problem to a fair number of users with a legitimate use case.

    It's not that it's useless. It's that it's stupid.

    14. CoffeeOnWrite ◴[] No.43794124{3}[source]
    (I’m in the anti-WAF camp) That does stand to improve your posture by giving you the ability to quickly apply duct tape to mitigate an active mild denial of service attack. It’s not utterly useless.
    replies(2): >>43794206 #>>43794423 #
    15. latexr ◴[] No.43794135{4}[source]
    I propose someone who doesn’t know or care how a system works shouldn’t be prescribing what to do to make it secure. Otherwise this is like suggesting every gate must have a lock to be secure, even those which aren’t connected to any walls.

    https://i.imgur.com/ntYUQB1.jpeg

    replies(1): >>43797156 #
    16. simonw ◴[] No.43794144[source]
    "But having it is generally better than not having it."

    I believe the exact opposite.

    One (of many) reasons is that it can make your code less secure, by hiding your security mistakes from you.

    If your WAF obscures escaping issues during your own testing and usage you could very easily let those escaping issues go unresolved - leaving you vulnerable to any creative attacker who can outsmart your WAF.

    replies(1): >>43794869 #
    17. elevation ◴[] No.43794206{4}[source]
    Doesn't it also add latency to every request?
    replies(4): >>43794319 #>>43794346 #>>43795846 #>>43796742 #
    18. tough ◴[] No.43794319{5}[source]
    I think the main point is the WAF companies must have lobbied to get that into the checklist

    the main point is you need to pay a third party

    replies(1): >>43795569 #
    19. ndsipa_pomu ◴[] No.43794355[source]
    It's merely security theater.

    It reminds me of when airports started scanning people's shoes because an attacker had used a shoe bomb. Yes, that'll stop an attacker trying a shoe bomb again, but it disadvantages every traveller and attackers know to put explosives elsewhere.

    replies(1): >>43795550 #
    20. krferriter ◴[] No.43794423{4}[source]
    Denial of service prevention and throttling of heavy users is a fine use, searching for a list of certain byte strings inside input fields and denying requests that contain them isn't.
    21. wyager ◴[] No.43794428[source]
    > But having it is generally better than not having it.

    Why? It obviously has an annoying cost and equally obviously won't stop any hacker with a lukewarm IQ

    22. augusto-moura ◴[] No.43794473[source]
    How would that be hard? Getting the absolute path of a string is in almost all languages stdlibs[1]. You can just grep for any string containing slashes and try resolve them and voilá

    Resolving wildcards is trickier but definitely possible if you have a list of forbidden files

    [1]: https://nodejs.org/api/path.html#pathresolvepaths

    Edit: changed link because C's realpath has a slightly different behavior

    replies(3): >>43797276 #>>43799951 #>>43804170 #
    23. pyrale ◴[] No.43794512{3}[source]
    Dropping 95% is even more secure, plus it lives the lucky few that get past it a sense of pride and exclusivity.
    replies(1): >>43794827 #
    24. Y_Y ◴[] No.43794827{4}[source]
    Is that like a "sense of pride and accomplishment"?

    https://knowyourmeme.com/memes/events/star-wars-battlefront-...

    25. RamRodification ◴[] No.43794869{3}[source]
    If you are in charge of testing code for escaping issues, and you do that through a WAF, you might not be very good at your job.
    26. rcxdude ◴[] No.43795337[source]
    Is it? The WAF is also now an attack surface itself, and I don't think WAFs have exactly proven themselves as something that meaningfully increases security. They certainly break things unpredictably, though.
    27. richardwhiuk ◴[] No.43795518[source]
    Every security solution can only stop a certain fraction of attacks.
    28. geoffpado ◴[] No.43795550{3}[source]
    “attacker had used a shoe bomb”

    It’s even dumber than that. An attacker tried and failed to use a shoe bomb, and yet his failure has caused untold hours of useless delay for over 13 years now.

    replies(1): >>43796609 #
    29. CoffeeOnWrite ◴[] No.43795569{6}[source]
    You can call your existing reverse proxy a WAF to check this checklist item. (Your point still stands, on the median companies may opt to purchase a WAF for various reasons.)
    replies(1): >>43800140 #
    30. formerly_proven ◴[] No.43795846{5}[source]
    So does running McAfee on every POST body but some places really wanna do that regardless. (I at least hope the scanner isn't running in the kernel for this one).
    replies(1): >>43796491 #
    31. hnlmorg ◴[] No.43795851[source]
    I’m going through exactly this joy with a client right now.

    “We need SQL injection rules in the WAF”

    “But we don’t have an SQL database”

    “But we need to protect against the possibility of partnering with another company that needs to use the same datasets and wants to import them into a SQL database”

    In fairness, these people are just trying to do their job too. They get told by NIST (et al) and Cloud service providers that WAF is best practice. So it’s no wonder they’d trust these snake oil salesman over the developers who asking not to do something “security” related.

    replies(1): >>43800137 #
    32. Macha ◴[] No.43796158[source]
    > But having it is generally better than not having it.

    The problem is that generally you're breaking actual valid use cases as the tradeoff to being another layer of defense against hypothetical vulnerabilities.

    Yes, discussing the hosts file is a valid use case.

    Yes putting angle brackets in the title of your message is valid use case your users are going to want.

    Yes putting "mismatched" single quotes inside double quotes is a thing users will do.

    Yes your users are going to use backslashes and omit spaces in a way that looks like attempts at escaping characters.

    (All real problems I've seen caused by overzealous security products)

    33. wavemode ◴[] No.43796295[source]
    No, that logic doesn't follow. If your application is so hopelessly vulnerable as to benefit from such naive filtering of the text "/etc/hosts, then your application is still going to be vulnerable in precisely the same ways, with just slightly modified inputs.

    It is net zero for security and net negative for user experience, so having it is worse than not having it.

    replies(1): >>43797432 #
    34. jrockway ◴[] No.43796491{6}[source]
    Yeah, we were asked to do this at my last job by some sort of security review. This one doesn't bother me as much. "Display 'network error' whenever a user uploads a file containing 'SELECT *'" is a bad user experience. "Some files in this repository have been flagged as containing a virus and are not visible in the web interface until allowed by an administrator," is OK with me, though.
    35. kevin_thibedeau ◴[] No.43796609{4}[source]
    Now you have to buy your liberty with pre-check.
    36. swyx ◴[] No.43796742{5}[source]
    sure but how much? 3-10ms is fine for the fast protection when shit hits the fan.
    37. kevincox ◴[] No.43796747[source]
    IMHO the primary value for WAFs is for quickly blocking known vulnerabilities with specific rules to mitigate vulnerabilities while they are being properly patched. Ideally the WAF knows what software is behind it (example WordPress, Java app, ...) and can apply filters that may be relevant.

    Anything else is just a fuzzy bug injector that will only stop the simplest scanners and script kiddies if you are lucky.

    38. MatthiasPortzel ◴[] No.43797156{5}[source]
    > someone who doesn’t know or care how a system works shouldn’t be prescribing what to do to make it secure

    The part that’s not said outloud is that a lot of “computer security” people aren’t concerned with understanding the system. If they were, they’d be engineers. They’re trying to secure it without understanding it.

    replies(1): >>43800393 #
    39. myflash13 ◴[] No.43797276[source]
    It’s not hard, but I think that’s more computation than a CDN should be doing on the edge. If your CDN layer is doing path resolution on all strings with slashes, that’s already some heavy lifting for a proxy layer.
    40. serial_dev ◴[] No.43797432{3}[source]
    Net zero for security might be generous.

    The way I assume it works in practice on a real team is that after some time, most of your team will have no idea how the WAF works and what it protects against, where and how it is configured… but they know it exists, so they will no longer pay attention to security because “we have a tool for that”, especially when they should have finished that feature a week ago…

    41. vultour ◴[] No.43799653[source]
    A large investment bank I worked for blocked every URL that ended in `.go`. Considering I mostly wrote Golang code it was somewhat frustrating.
    42. watusername ◴[] No.43799951[source]
    > How would that be hard? Getting the absolute path of a string is in almost all languages stdlibs[1]. You can just grep for any string containing slashes and try resolve them and voilá

    Be very, very careful about this, because if you aren't, this can actually result in platform-dependent behavior or actual filesystem access. They are bytes containing funny slashes and dots, so process them as such.

    Edit: s/text/bytes/

    43. zelphirkalt ◴[] No.43800137{3}[source]
    If they want to do their job well, how about adding some thinking into the mix, for good measure? Good would also be,if they actually knew what they are talking about, before trying to tell the engineers what to do.
    replies(2): >>43801628 #>>43802111 #
    44. zelphirkalt ◴[] No.43800140{7}[source]
    Often it is just pushing responsibility.
    45. saagarjha ◴[] No.43800393{6}[source]
    Good computer security people are engineers.
    46. hnlmorg ◴[] No.43801628{4}[source]
    > If they want to do their job well, how about adding some thinking into the mix, for good measure?

    That’s what the conversation I shared is demonstrating ;)

    > Good would also be,if they actually knew what they are talking about, before trying to tell the engineers what to do.

    Often the people enduring the rules aren’t supposed to be security specialists. Because you’ll have your SMEs (subject matter experts) and your stockholders. The stakeholders will typically be project managers or senior management (for example) who have different skill sets and priorities to the SMEs.

    The problem is that when it comes to security, it’s a complicated field where caution is better than lack of caution. So if a particular project does call on following enhanced secret practices, it becomes a ripe field for snake oil salesman.

    Or to put it another way: no company would get sued for following security theatre but they are held accountable if there is a breach due to not following security best practices.

    So often it doesn’t matter how logical and sensible the counter argument is, it’s automatically a losing argument

    47. immibis ◴[] No.43802111{4}[source]
    They don't want to do their job well. They want to look like they're doing their job well, to people who don't know how to do the job and whose metrics are completely divorced from actual merit.
    48. tom1337 ◴[] No.43802345[source]
    Well I've just created an account on substack to test this but turns out they've already fixed the issue (or turned off their WAF completely)
    49. TheDong ◴[] No.43804170[source]
    The reason it's doomed to failure is because WAFs operate before your application, and don't have any clue what the data is.

    Here is a WAF matching line: https://github.com/coreruleset/coreruleset/blob/943a6216edea...

    Here's where that file is loaded: https://github.com/coreruleset/coreruleset/blob/943a6216edea...

    It's loaded with '"@pmFromFile lfi-os-files.data"' which means "case-insensitive match of values from a file".

    So yeah, the reason it can't resolve paths properly is because WAFs are just regex and substring matching trying to paper over security issues in an application which can only be solved correctly at the application level.