News for hackers. Stuff that matters.
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by bhaney on Saturday January 13, 2024 @07:42PM (#38986254)
Any code including netcat (for it's tendency to be used in reverse shells) or SQL (for it's tendency to be used in SQL injections) tends to be blocked across the entire cloudflare-net these days.
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by zikduruqe on Saturday January 13, 2024 @09:19PM (#38986781)
Interesting. That's the first time I have run across this. Makes sense.
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by crotchfire on Saturday January 13, 2024 @10:13PM (#38987072)
That does not make sense at all; it is batshit-crazy broken.
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by r1ch on Saturday January 13, 2024 @10:33PM (#38987183)
Welcome to the world of WAFs. Pattern matching scary strings is big business.
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by cubefox on Saturday January 13, 2024 @10:47PM (#38987244)
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by rrr_oh_man on Saturday January 13, 2024 @11:15PM (#38987404)
Thanks. For me WAF is https://en.wikipedia.org/wiki/Wife_acceptance_factor since the 2000's era of German audio enthusiast forums
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by wslh on Saturday January 13, 2024 @11:02PM (#38987312)
Believe me you can find them present in popular sites you use everyday ;-) I caught one of them and reported it.
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by refulgentis on Saturday January 13, 2024 @11:25PM (#38987459)
what dark magic is this? do you put it in front of all POSTs or something?
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by Uvix on Sunday January 14, 2024 @12:19AM (#38987736)
Not just POSTs, but any HTTP request - headers & query strings get inspected too.
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by josephcsible on Sunday January 14, 2024 @02:45AM (#38988364)
Indeed. WAFs need to die; they're basically all just doing <https://thedailywtf.com/articles/Injection_Rejection>.
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by bandergirl on Sunday January 14, 2024 @03:18AM (#38988523)
That code makes me sick to my chest. Why are some people allergic to reading?

<Receives solution>

Nah I’m not opening that link, I got it

Re:Ask HN: Does Cloudflare block HN comments if you have cod... by jiggawatts on Sunday January 14, 2024 @04:44AM (#38988956)
Even if they got the link, read it, they probably didn't fully understand the concepts.

I wish this was a joke, but just last month I spent literally hours arguing with multiple people -- on shore -- that that kind of query rewrite/rejection approach was never going to work properly, and only properly parameterised queries were correct.

Nope.

Fix after fix, then fixes for the fixes, then workarounds for the glitches, and then... on and on.

It was incredible to me that in 2023, supposedly senior technical team leads would have heated arguments rejecting parameterised queries and favouring regex WAF instead.

Re:Ask HN: Does Cloudflare block HN comments if you have cod... by egeozcan on Sunday January 14, 2024 @05:24AM (#38989176)
A common problem with technical leads is that occasionally they tend to forget that they can't know all the correct solutions and it's usually better to yield to those who do. Sometimes seniority makes this even worse.

Source: After so many years of dealing with bad technical decisions became a TL myself :)

Re:Ask HN: Does Cloudflare block HN comments if you have cod... by Dylan16807 on Tuesday January 16, 2024 @12:13AM (#39009757)
> query rewrite/rejection approach was never going to work properly, and only properly parameterised queries were correct

...what do you mean by "rewrite/rejection"?

If rewrite means "escaping strings using the database function designed for that purpose", then that approach works just fine. It's not comparable to rejection at all.

If they were making their own version, then the underlying problem is that they were making their own version. Parameterised queries are lovely but they are not the only option.

Re:Ask HN: Does Cloudflare block HN comments if you have cod... by jiggawatts on Tuesday January 16, 2024 @05:26AM (#39011676)
I mean that they were doing simple things like replacing a single quote (dangerous!) with a double single quote. E.g.: ' -> ''

That means that when a user called Bob O'Neill enters their name, instead of returning a HTTP/500 error, the database stores Bob O''Neill.[1]

Then when the user goes to edit their form, they will see O''Neill. Okay, oops, that's a mistake, let's just replace all double single quotes with a single quote when outputting HTML! Now it'll say O'Neil correctly!

Of course, if you enter some bad text with double single quotes via some other mechanism such as a CSV upload, there's a decent chance that'll it'll be incorrectly stripped. Perhaps in some mid-tier API, which will then interpret it as a single quote, resulting in an injection vulnerability (or data corruption) again.

That can be fixed with "mere" man months of effort instead of the minutes it would have taken to just use the parameterised queries like God intended.

Now that that nightmare is over once and for all... what to do about % symbols screwing up LIKE searches? I dunno, that's complicated, so let's just replace all...

... rinse, repeat, ad infinitum.

[1] Oh, oh, you assumed that the query engine would replace '' with ' and the database would store the correct text? Hah-haaa.... you assumed that this "fix" was applied only once! What's fun about band-aids is that they're so easy to accidentally layer three or four deep without even realising. More band-aids == more safe, am I right?

Re:Ask HN: Does Cloudflare block HN comments if you have cod... by formerly_proven on Sunday January 14, 2024 @06:59AM (#38989647)
Found a webshop once which issued IP bans when you triggered their WAF. Coincidentally, some product permalinks (containing the product name) triggered their WAF. Great conversion rate on those, I’m sure.

YOU HAVE BEEN BLOCKED FOR MALICIOUS ACTIVITY surely has to be good for business. Not that most would know, considering the trackers won’t load when this happens.

Re:Ask HN: Does Cloudflare block HN comments if you have cod... by cheekibreeki2 on Sunday January 14, 2024 @09:52AM (#38990910)
You're out of your mind. Protecting your site > The opinions of nerds.
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by RockRobotRock on Sunday January 14, 2024 @06:05PM (#38995375)
Why would you grossly oversimplify something you know is untrue
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by EasyMark on Sunday January 14, 2024 @10:28PM (#38997156)
"Needs to die" is a bit harsh but there are alternatives that are better and more secure. If you're just a regular sysadmin and only want to spend 8-9 hours a day at work you might just use a WAF instead and deal with the lost performance/added cost.
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by Jabrov on Saturday January 13, 2024 @10:26PM (#38987144)
How does that make sense?
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by kevindamm on Saturday January 13, 2024 @10:32PM (#38987176)
I think they meant "corresponds with behavior observed" not "sounds rational."
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by tambourine_man on Saturday January 13, 2024 @10:46PM (#38987238)
In a site like HN, that’s ridiculous.
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by goles on Saturday January 13, 2024 @11:24PM (#38987452)
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by Dylan16807 on Sunday January 14, 2024 @02:05AM (#38988190)
I see it. It explains why cloudflare is involved at all. But I don't see how this is related to the comment you replied to, which is saying that the text filter is ridiculous.
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by renonce on Sunday January 14, 2024 @04:27AM (#38988879)
Sites like HN could have disabled WAF. It's entirely configurable on HN's side. Let's just wait until dang wakes up and implement the required changes.
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by cwillu on Sunday January 14, 2024 @05:15PM (#38994970)
“Thanks for the heads-up! We'll probably be off Cloudflare fairly soon - I think that's more likely the better fix. But if we end up being forced to stay on it, we'll look into configuring those rules.” --reply to an email I sent
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by creatonez on Saturday January 13, 2024 @10:47PM (#38987247)
AFAIK most of these filters are disabled by default when setting up your website on Cloudflare, so most websites using the Cloudflare network likely have this turned off.
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by stingraycharles on Sunday January 14, 2024 @12:22AM (#38987761)
This is correct, it’s part of their WAF offering where there is rule-based blocking of content.
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by viraptor on Sunday January 14, 2024 @03:17AM (#38988517)
Also, it's not one magic switch. You can switch each of those rules on/off. Ideally HN would allow most of the injection ones, otherwise we won't be able to post examples of specific SQL patterns and the like.
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by judge2020 on Sunday January 14, 2024 @01:42AM (#38988100)
And requires the $20/month plan to enable.
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by dvh on Sunday January 14, 2024 @03:24AM (#38988543)
drop table users where id=id
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by kristianp on Sunday January 14, 2024 @10:37PM (#38997202)
Select id, email from users;

Works. Any sql thats actually blocked?

Re:Ask HN: Does Cloudflare block HN comments if you have cod... by gus_massa on Saturday January 13, 2024 @09:14PM (#38986757)
To get a fast answer, it's beter to send an email to the mods [email protected]
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by LeoPanthera on Sunday January 14, 2024 @03:00AM (#38988436)
In this case, I appreciate that OP made a public post, in case others encounter the same problem.
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by gus_massa on Sunday January 14, 2024 @06:18AM (#38989451)
dang is not reading every single post in real tieme, so posts may get unoticed and the guidelines ask to send an email instead.

In this case, it looks like some comments are giving good advice about the tradeoff and how to fix it, so I have to agree with you.

Re:Ask HN: Does Cloudflare block HN comments if you have cod... by kaimac on Saturday January 13, 2024 @10:14PM (#38987074)
Cloudflare has access to everyone's cleartext? I was unaware of this. NSA must love that
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by judge2020 on Sunday January 14, 2024 @12:12AM (#38987698)
Same for Akamai, Cloudfront, Fastly, etc. Pretty much every business that wants to offload DDOS protection, caching,and some level of frontline security uses a proxying CDN.

An alternative is to keep all of your CDN assets on a CDN bucket on its own hostname, with your main secret-containing business apps on your own servers, but it costs a lot to manage this level of separation and the payoff is only protection against the theoretical attack of "NSA can't attack our users/spy on them". If the NSA ever did do this on a large enough scale or to target a particularly notable person, it's very unlikely it would be kept a secret for long, and the end-business that used Cloudflare et al. wouldn't be implicated whatsoever since every business uses one of the big CDN providers.

Re:Ask HN: Does Cloudflare block HN comments if you have cod... by bejk22 on Sunday January 14, 2024 @12:46AM (#38987865)
That makes using https instead of http a lot less relevant.
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by judge2020 on Sunday January 14, 2024 @01:30AM (#38988064)
https is important for preventing spying by anyone else in between you and the server. ISPs, coffee shop owners, schools, etc used to spy on http traffic to see what people were doing/searching for, and ISPs like xFinity injected code into non-https pages to show "important messages" to users, e.g. going over your bandwidth limit[0].

The only weak link now is Cloudflare, which is still "less secure than a direct connection" (with respect to government spying, bugs[0], hackers, etc) but the threat level is drastically reduced.

0: https://blog.ryankearney.com/2013/01/comcast-caught-intercep...

1: https://news.ycombinator.com/item?id=13766339

Re:Ask HN: Does Cloudflare block HN comments if you have cod... by xk_id on Sunday January 14, 2024 @02:02AM (#38988176)
Is there a way to know when the encrypted content i send to a site is also being provided to Cloudflare?
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by viraptor on Sunday January 14, 2024 @03:31AM (#38988575)
Check the whois entry for the IPs that domain resolves to. If they belong to CloudFlare, they can see the plaintext traffic. Same for Akamai, Cloudfront and others.
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by tick_tock_tick on Sunday January 14, 2024 @05:23AM (#38989169)
No, just like there is no way to know if a site not fronted by cloudflare decided to send all traffic their after.
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by tcmb on Sunday January 14, 2024 @06:49AM (#38989600)
Isn't the SSL certificate being issued by Cloudflare a giveaway?

I'm guessing it's a sufficient condition, bit not a necessary one. I.e, a could be using Cloudflare's WAF with a SSL cert issued by somebody else.

Re:Ask HN: Does Cloudflare block HN comments if you have cod... by judge2020 on Sunday January 14, 2024 @06:07PM (#38995403)
Cloudflare can issue from Google Trust Services/Digicert with ACM[0] and often does even without ACM (although maybe only for Business/Enterprise domains).

0: https://developers.cloudflare.com/ssl/edge-certificates/adva...

Re:Ask HN: Does Cloudflare block HN comments if you have cod... by judge2020 on Sunday January 14, 2024 @10:45AM (#38991426)
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by EasyMark on Sunday January 14, 2024 @10:37PM (#38997203)
I too inject porn images, inverted images, backwards texst, etc in http back in the day for people piggybacking (without permission) off my wifi.
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by anonym29 on Sunday January 14, 2024 @01:33AM (#38988078)
Hardly! Nobody is forcing you to consent to MITM, you freely choose it every time you voluntarily use a website that utilizes one.
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by anonym29 on Sunday January 14, 2024 @12:55PM (#38992568)
To downvoters: please don't shoot the messenger. I'm not happy about the existence of Cloudflare (or their competitors who do the same thing) either.

That said, the choice is yours whether or not to use sites that utilize such untrustworthy MITM providers, like Cloudflare. There are even browser plugins that can automatically block connections to such untrustworthy entities.

This isn't an endorsement, and you should always review the source code of any browser extensions you're utilizing due to the risks extensions themselves can pose, but I personally use one called Cloud Firewall and it works great. (https://addons.mozilla.org/en-US/firefox/addon/cloud-firewal...)

Re:Ask HN: Does Cloudflare block HN comments if you have cod... by Dylan16807 on Tuesday January 16, 2024 @12:23AM (#39009803)
An extension that tries to to block cloudflare is getting closer to making your original statement true, but it's still not true.

There aren't obvious signs up front that a site is using cloudflare. Failure to spend time investigating is not "freely choosing it".

Re:Ask HN: Does Cloudflare block HN comments if you have cod... by anonym29 on Tuesday January 16, 2024 @02:24AM (#39010413)
>There aren't obvious signs up front that a site is using cloudflare.

You're joking, right?

It takes 2 seconds to click the padlock in your browser, click through once more, and see "Verified by: Cloudflare, Inc". You don't even need to view the certificate.

If 2 seconds and 2 clicks is too much time and effort, it's obviously not actually that important to the user in question.

Re:Ask HN: Does Cloudflare block HN comments if you have cod... by Dylan16807 on Tuesday January 16, 2024 @02:49AM (#39010606)
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by cheekibreeki2 on Sunday January 14, 2024 @09:56AM (#38990934)
All of the modern http performabce optimizations require https.
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by bomewish on Sunday January 14, 2024 @01:16AM (#38987987)
They kept the other spying secret for a long time and it was only due to pretty heroic actions by one person that it got exposed. So I duno.
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by ytch on Saturday January 13, 2024 @10:59PM (#38987296)
It's a TLS termination proxy that decrypt and re-encrypt your TLS packet. Technically Cloudflare can read anything unless you add your own crypt layer on top of TLS.
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by strombofulous on Saturday January 13, 2024 @10:16PM (#38987090)
Yes, although it requires configuration https://developers.cloudflare.com/ssl/get-started/
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by creatonez on Saturday January 13, 2024 @10:42PM (#38987227)
When you add a DNS rule, it's configured as proxied by default. Here is what it looks like in the UI:

https://i.imgur.com/TO2Tfk3.png

https://i.imgur.com/jVW5db4.png

Re:Ask HN: Does Cloudflare block HN comments if you have cod... by arch-choot on Saturday January 13, 2024 @10:32PM (#38987177)
I'm pretty sure the default is they can see all the cleartext, since their product is based on TLS interception, for example to evaluate page rules.

This is also how they insert extra headers in both the request and response.

Re:Ask HN: Does Cloudflare block HN comments if you have cod... by midasuni on Sunday January 14, 2024 @10:11AM (#38991080)
If cloudflare have thr certificate’s private key and are advertising the A record they have access to everything you send, from emails to credit card numbers.
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by stingraycharles on Sunday January 14, 2024 @12:25AM (#38987776)
It’s a CDN that caches content and it’s able to inject “are you human?” verification pages, it can rewrite content on demand (e.g. serve optimized images / html / JavaScript). It seems obvious to me that they have access and ability to modify all cleartext content in-flight.
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by mlindner on Sunday January 14, 2024 @01:17AM (#38987991)
Yes that's how Cloudfare works. The TLS certificate for basically any website using Cloudflare "ends" at Cloudflare's servers. It's then either forwarded on to the actual servers in cleartext or re-encrypted with an internal company certificate (maybe signed internally as well) to pass the connection on to the actual servers. It was the easy way many companies who didn't have the expertise to do their own certificate management moved from the http world to the https world. They just handed it off to cloudflare and kept their servers running http.

F5 Networks, my former employer, sells something similar, but it's a box (or virtual appliance) you put in your own data centers somewhere that dead-ends the connection instead.

Re:Ask HN: Does Cloudflare block HN comments if you have cod... by jpc0 on Sunday January 14, 2024 @04:07AM (#38988756)
Btw the same is possible for phishing sites.

It's entirely possible to have a proper SSL connection to a bogus hostname, that is showing the correct website and even interacts correctly.

Bogus MITM decrypts the traffic, logs it, then forwards the traffic once again encrypted to the destination server. Then does the reverse for the resonse.

"Look for the padlock" is only useful if the actual hostname is correct in the browser.

If I hosted news.ycombnator.com using this and you didn't notice that I could be proxying just like that. It's possible cloudflare has protections against this in place but doesn't every website on earth?

Look at the damned hostname people.

Re:Ask HN: Does Cloudflare block HN comments if you have cod... by cheekibreeki2 on Sunday January 14, 2024 @09:55AM (#38990928)
And every big company can decrypt your tls web traffic with their special CA keys.
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by fragmede on Sunday January 14, 2024 @10:46AM (#38991442)
Can you explain what you mean a bit more? My connection to eg my bank isn't decryptable by anybody but me and my bank (and their CDN which is serving their certificate). That is, eg, Verisign has root CA keys to sign the cert, and they could give me a cert that says they're my bank and I could make a new connection that they could decrypt, but the original connection to my bank can't be decrypted by their keys.
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by crotchfire on Saturday January 13, 2024 @10:15PM (#38987078)
Dear cloudflare, please banhammer me

    cat testfile.txt | nc 192.168.2.100 1234
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by throwaway14356 on Sunday January 14, 2024 @01:00AM (#38987922)
finally a way out
[dead]
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by Dylan16807 on Sunday January 14, 2024 @02:13AM (#38988222)
I hope you figure out that annoying people doesn't make you right. We can only dream of a world where it's difficult to be annoying, and requires putting in some effort to be right first.

> stealing from users

What a weird definition of stealing.

And it's as much an issue with your browser if hitting back doesn't return the text. There are extensions to improve that behavior.

But what I find really interesting is that you seem to think being mad about an issue is a reason to break a completely unrelated rule?

Re:Ask HN: Does Cloudflare block HN comments if you have cod... by ShadowBanThis01 on Sunday January 14, 2024 @04:48AM (#38988978)
That’s pathetic. Some insecure or maladjusted twerps might get “annoyed,” so we can’t joke around with each other? So oh boy, we’d better walk on eggshells lest some friendless asshole “flag” us?

Your time is apparently free, given your bafflement at how stealing it is stealing. I don’t know what you’re on about with “browser issues,” because that’s not it. If you can’t post, the button to raise the text-entry UI should be DISABLED. Anyone on this site should understand and expect that. This has been an egregious abuse of users for years, and there’s no excuse for it.

As far as what “rules” you think I’m breaking (which you didn’t manage to specify) and being “mad…” I’m not the one flagging and burying other users’ posts. If I annoy pompous, self-important pricks that’s a win. One of them has gone through and downvoted all my posts now, proving my point: HN is going the way of Reddit. Flag away.

Re:Ask HN: Does Cloudflare block HN comments if you have cod... by Dylan16807 on Sunday January 14, 2024 @09:39AM (#38990797)
I didn't say to avoid jokes. Joking and being antagonistic are different things!

And I still don't think stealing is the right word for that kind of technical issue, especially when it's still half your browser's fault.

> which you didn’t manage to specify

Why would I need to specify something you brought up? "OH NOES comparing HN to Reddit violates "policy.""

> and being “mad…”

Is "aggressive griping about" better? People usually simplify that to "mad about".

> One of them has gone through and downvoted all my posts now

Almost every post you made inside that 24 hour downvote window deserves it, so depending on how literal that "all" is, they're probably helping and not a bad actor.

Re:Ask HN: Does Cloudflare block HN comments if you have cod... by porridgeraisin on Sunday January 14, 2024 @03:13AM (#38988499)
How did this get past the check?
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by furyofantares on Saturday January 13, 2024 @10:23PM (#38987126)
Huh. Just tried submitting the same comment with the same result.

Minimal test, if I try to edit this post removing the asterisk, I get the "banned" page

  nc* 192.168.2.100
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by neilv on Saturday January 13, 2024 @11:09PM (#38987360)
Probably not related, but I've been getting lots of throttling-like huge page load delays on HN the last couple days, only when logged in.

Any idea whether that's just an overloaded application server, or something Cloudflare is doing?

Re:Ask HN: Does Cloudflare block HN comments if you have cod... by pixelesque on Saturday January 13, 2024 @11:17PM (#38987417)
That's often the case with HN I think from past experience when there are large threads on HN, and dang has in the past said that's due to the application server.
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by keepamovin on Saturday January 13, 2024 @11:26PM (#38987463)
Single core application server no less
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by diggan on Sunday January 14, 2024 @08:10AM (#38990087)
Crafted by first creating a language, then a framework and then the "news" application.

The holy grail of NIH :)

Re:Ask HN: Does Cloudflare block HN comments if you have cod... by keepamovin on Sunday January 14, 2024 @10:06PM (#38997027)
Do things that don't scale! haha
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by djha-skin on Saturday January 13, 2024 @11:33PM (#38987511)
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by hyperhello on Saturday January 13, 2024 @11:59PM (#38987641)
What if you Base64 encode this? Pretty trivial to add to the form logic.
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by dylan604 on Sunday January 14, 2024 @12:52AM (#38987893)
yeah, i'd expect dang to just jump right on that. just because you feel it is trivial does not mean that it should be done.
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by kevincox on Sunday January 14, 2024 @09:03AM (#38990447)
That's how one of my past employers resolved this. Basically base64 encoded every field in the JSON as someone reported a bug where the WAF blocked it. Not only was this done inconsistently and was super tedious but completely defeated the purpose of the WAF. (Except of course to check the checkbox that we had a WAF.)
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by usr1106 on Sunday January 14, 2024 @12:12AM (#38987701)
So HN uses Cloudflare? That surprises me because typically I notice sites using Cloudflare because my mobile running GNU Linux cannot pass their dreaded Turnstyle. Luckily thst does not happen for HN.
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by judge2020 on Sunday January 14, 2024 @12:16AM (#38987718)
They used to run it but stopped (I want to say) around 2016 or 2017. Another poster here linked[0] to how dang confirmed it is to protect against a DDOS attack.

0: https://news.ycombinator.com/item?id=38939668

Re:Ask HN: Does Cloudflare block HN comments if you have cod... by usr1106 on Sunday January 14, 2024 @12:52AM (#38987890)
The cert is Cloudflare today.
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by judge2020 on Sunday January 14, 2024 @12:56AM (#38987904)
I meant to imply that Dang only re-added CF recently due to the attacks. They haven't used CF in many years to my knowledge.
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by redcobra762 on Sunday January 14, 2024 @03:08AM (#38988475)
Cert was issued over 9 months ago.
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by ffpip on Sunday January 14, 2024 @04:07AM (#38988754)
The certificate is for *.ycombinator.com.

The main YCombinator site might have been using Cloudflare seen years, and now HN might have been added to the same account to protect from a DOS attack.

So might be the same cert?

Re:Ask HN: Does Cloudflare block HN comments if you have cod... by nuker on Sunday January 14, 2024 @08:07PM (#38996200)
It also means Cloudflare sees HN traffic in plaintext, including login/passwords
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by cj on Sunday January 14, 2024 @01:05AM (#38987941)
The aggressiveness of the "dreaded Turnstyle" is 100% configurable.

It's very easy to disable it completely via Cloudflare settings. Using cloudflare doesn't require you to use all of its features, and almost every feature can be turned off.

Re:Ask HN: Does Cloudflare block HN comments if you have cod... by helsinkiandrew on Sunday January 14, 2024 @03:49AM (#38988651)
I always feel the turnstyle makes a website feel a bit condescending - you need to test MY connection before I get to your crappy site?

Is there a reason it needs to be visible whilst performing checks? or is it just security theatre?

Re:Ask HN: Does Cloudflare block HN comments if you have cod... by egeozcan on Sunday January 14, 2024 @05:27AM (#38989190)
I always assumed that it is running some client side sanity checks to detect automated user agents but never checked.
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by bombcar on Sunday January 14, 2024 @09:00AM (#38990418)
It’s just doing hash math (think like bitcoin mining) to make your CPU burn enough processing time to make a layer seven DDoS not worthwhile. It works. Because now the server uses way less processing time than the client did.
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by peetistaken on Sunday January 14, 2024 @01:15PM (#38992811)
That is not true. It does a whole bunch of checks, like fingerprinting your GPU, environment, etc. The checks are even run in a custom VM, and are heavily protected. The gathered data is then sent back to cloudflare, and you either get an access cookie (cf_clearance) back, or not.
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by explaininjs on Sunday January 14, 2024 @07:22AM (#38989804)
There are many options to configure it, the main reason to make it always visible and blocking is that the callbacks for managing the hidden/on-demand version are wonky and can break in unexpected ways leaving your site entirely unusable, with the only indication being some errors logged to console.
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by zhfliz on Sunday January 14, 2024 @08:01AM (#38990032)
it's free advertising
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by rollcat on Sunday January 14, 2024 @08:37AM (#38990239)
> or is it just security theatre?

WAF in general is security theatre. If your operation genuinely benefits from one, I dread for what's sleeping underneath. Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn.

Re:Ask HN: Does Cloudflare block HN comments if you have cod... by viraptor on Sunday January 14, 2024 @03:20AM (#38988532)
While this is true and worth reminding the ops about, it still sucks because many people don't understand the issues they cause by turning WAF on. CloudFlare should have a big "I understand I'll block many legit clients when I enable this" checkbox. Or you know... fix it in general. Or at least have a "report this block as invalid" link on the page.
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by Jamie9912 on Sunday January 14, 2024 @03:25AM (#38988551)
Agreed, I believe the default Firewall security level is "Medium" and I think that's far too strict. First thing I do when adding a new zone is to set it to "Essentially off"
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by Aachen on Sunday January 14, 2024 @06:52AM (#38989618)
First thing I do is not use cloudflare when I don't need big brother anyway
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by fragmede on Sunday January 14, 2024 @10:36AM (#38991334)
Which is easy enough to say, but how do you protect your site from being ddosed?
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by Aachen on Sunday January 14, 2024 @02:52PM (#38993794)
None of my sites have been in over a decade of hosting from a residential connection

When it's needed, it's needed, but it amazes me how many people feel they need big brother protection for their personal blog and nextcloud

Re:Ask HN: Does Cloudflare block HN comments if you have cod... by fragmede on Monday January 15, 2024 @03:54AM (#38998703)
how many people do you piss off with the opinions you post on your blog? enough to warrant being DDoS'd by an emotionally stunted highschooler with their parents/stolen credit card and the ability to Google for a botnet?
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by Aachen on Thursday January 18, 2024 @03:36AM (#39039415)
Almost nobody who uses big brother as an individual ever does. What would anyone care about a nextcloud login panel? Or a reasonably civil personal blog? And yet they enable cloudflare for yet another small corner of the internet :(
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by aeyes on Sunday January 14, 2024 @06:47AM (#38989593)
Cloudflare WAF doesn't block clients in general, it blocks based on the data the client sends to the server.

Unless your client sends a string which matches one of the WAF patterns the site will work fine. It only blocks individual requests.

Now the problem here is that you probably shouldn't enable the WAF without having it in log only mode for a while if you are operating a site which let's users submit arbitrary text input. Of course it's going to match... You'll have to adjust the configuration.

Re:Ask HN: Does Cloudflare block HN comments if you have cod... by bombcar on Sunday January 14, 2024 @09:01AM (#38990431)
I’ve yet to see a WAF that wasn’t eventually accidentally triggered by some zip file.

I’ve had to recompress zip files with a higher compression setting to get around whatever string was triggering it.

Re:Ask HN: Does Cloudflare block HN comments if you have cod... by a-dub on Sunday January 14, 2024 @01:47AM (#38988116)
bummer. i used to like the legend that it was all on one commodity linux pc implemented in some nice concise lisp running on sbcl.

edit: my memory is crap. it was a single machine, but the codebase was written in a custom experimental language that i think was a lisp derivative. (which would make sense!). the source was online at some time, can't find it now.

Re:Ask HN: Does Cloudflare block HN comments if you have cod... by usr1106 on Sunday January 14, 2024 @03:04AM (#38988456)
I understand the backend is still somewhat limited. After Altman was fired (IIRC) when HN got 1000s of comments within no time, dang asked everyone to logout and login again, to make life for the poor machine a bit easier. So besides limited HW resources, also some non-optimal implementation details ;)
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by lolinder on Sunday January 14, 2024 @12:02PM (#38992108)
It still is a single single-core server, dang references it frequently when there's unusually high traffic [0]. And the language you're referring to is Arc [1]. They do have caching for not-logged-in users, historically done through nginx [2]. From other comments in this thread, it sounds like they just temporarily put Cloudflare in front of that single server to block a DDoS.

[0] https://news.ycombinator.com/item?id=38310213

[1] https://arclanguage.github.io/

[2] https://news.ycombinator.com/item?id=26473226

Re:Ask HN: Does Cloudflare block HN comments if you have cod... by dividuum on Sunday January 14, 2024 @05:12AM (#38989119)
Yep. Without leaving the browser, https://news.ycombinator.com/cdn-cgi/trace confirms that.
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by usr1106 on Sunday January 14, 2024 @06:18AM (#38989456)
Oh, how did you find that? Some inside knowledge about HN or is that a well-known path published by Cloudflare sites?

Edit: Seems to work also for at least some other Cloudflare sites. Interestingly HN is served from Stockholm (behind a sea cable) while others are served from Helsinki (should be closer). Not enough hackers here in Finland?

Edit 2: Works also on sites where Turnstyle keeps me out.

Re:Ask HN: Does Cloudflare block HN comments if you have cod... by dubcanada on Sunday January 14, 2024 @06:35AM (#38989531)
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by LinuxBender on Monday January 15, 2024 @09:33AM (#39001382)
It is at the moment.

    news.ycombinator.com. 3710 IN CNAME news.ycombinator.com.cdn.cloudflare.net.
    news.ycombinator.com.cdn.cloudflare.net. 3710 IN A 104.22.6.236
    news.ycombinator.com.cdn.cloudflare.net. 3710 IN A 172.67.5.232
    news.ycombinator.com.cdn.cloudflare.net. 3710 IN A 104.22.7.236
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by nneonneo on Sunday January 14, 2024 @01:48AM (#38988124)
I ran into this when trying to post a comment with

  ../ ../ ../ etc/ passwd

(remove the spaces)
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by M4v3R on Sunday January 14, 2024 @04:12AM (#38988782)
Yep, confirmed on my side too that it does indeed get blocked.
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by Jamie9912 on Sunday January 14, 2024 @03:24AM (#38988542)
I don't remember HN being on Cloudflare. Have they recently added it?
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by ignoramous on Sunday January 14, 2024 @08:02AM (#38990043)
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by jrockway on Sunday January 14, 2024 @03:37AM (#38988602)
This line works:

   nc -l -p 1234 -q 1 > testfile.txt < /dev/null
The other one doesn't.

   alias foobar=nc
   cat testfile.txt | foobar 192.168.2.100 1234
I was hoping that it was a "useless use of cat" filter, but nope. It just doesn't like the bytes nc next to an IPv4 address.

This is also fine, but blocked if you change the slash to a dot:

   nc 192/168.2.100 1234
This works too:

   nc \
   192.168.2.100 1234
OK, that's all for now. Can you believe people pay money for "web application firewalls"?
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by david_draco on Sunday January 14, 2024 @05:01AM (#38989052)
Good that there are open source alternatives:

  socat - TCP4:192.168.2.100:1234

  socat TCP4-LISTEN:1234,fork,reuseaddr -
https://www.redhat.com/sysadmin/getting-started-socat
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by gnfargbl on Sunday January 14, 2024 @05:13AM (#38989120)
> Can you believe people pay money for "web application firewalls"?

I think it's like a lot of things in computer security, in that system owners just don't want to be the slowest gazelle in the herd. If an attacker is mass-exploiting some new remote vulnerability, then maybe the WAF means that you're one of the lucky ones who doesn't get hit. And yes, that's a very big maybe there.

WAFs don't do much to prevent targeted attacks except to require the attacker to craft a WAF bypass. As you've shown.

Re:Ask HN: Does Cloudflare block HN comments if you have cod... by H8crilA on Sunday January 14, 2024 @08:47AM (#38990319)
They also have an organizational purpose. Once an attack happens you can shift the blame onto the WAF. And the WAF provider can, if needed, claim this to be a novel attack against which they have prepared for the future. Even issue an emergency patch that detects and blocks the novel backslash-newline line break technique.

(I'm exaggerating here, but only a bit)

Re:Ask HN: Does Cloudflare block HN comments if you have cod... by graemep on Sunday January 14, 2024 @11:42AM (#38991934)
In cynical moments I think the main driver of IT decision making is CYA.
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by kevincox on Sunday January 14, 2024 @08:57AM (#38990399)
I think that important difference though. WAFs are very useful when they are used as a quick fix for a zero-day vulnerability. Especially if you are running some generic software like WordPress and can subscribe to a managed WordPress rule set.

The key is that they should mitigate specific vulnerabilities and ideally once the proper fix is deployed the rules are then removed from the WAF.

WAFs have near-zero value for things like trying to detect shell-code or generic SQL injections as they just turn into fuzzy bug injectors. Any real attacker will very quickly find a way to structure their exploit to avoid the heuristics.

WAFs also have minimal value for custom software. Because even if you use it to deploy a quick block for an exploit unless you are just blocking a whole endpoint the attacker will also likely find a way to work around it.

Re:Ask HN: Does Cloudflare block HN comments if you have cod... by teeray on Sunday January 14, 2024 @10:23AM (#38991191)
Also, never underestimate the power of FIPS999999999 or whatever compliance. If it’s a checklist item to have a bowl full of M&Ms without brown ones in your data center, your security people will make sure that box gets checked. It doesn’t matter how outdated the requirement is.
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by mac-chaffee on Sunday January 14, 2024 @08:45AM (#38990307)
WAFs are 2000s-era software that have long overstayed their welcome: https://www.macchaffee.com/blog/2023/wafs/
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by mr_mitm on Sunday January 14, 2024 @09:27AM (#38990698)
Nice summary.

I can add to the list of attack vectors a case where the WAF introduced a reflected cross-site scripting vulnerability. The site it was supposedly protecting was blank, i.e. it just returned a 404 error or something. But just by appending a URL parameter with JS in it, the WAF would trigger and reflect the code. So I was able to build an outlook web app lookalike for phishing on a site with the domain of the company.

Re:Ask HN: Does Cloudflare block HN comments if you have cod... by leftnode on Sunday January 14, 2024 @10:46AM (#38991438)
Excellent article, thanks for writing and posting it.
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by kazinator on Sunday January 14, 2024 @01:45PM (#38993160)
Summary:

1. WAFs require entire requests to be buffered in order to be scanned before the server sees them. This can require lots of RAM.

2. WAFs scan requests with all sorts of hacky rules, which takes gobs of CPU time.

3. The hacky rules look for programming language syntax, for which the attackers can easily find alternative expressions to get around the rules.

4. ... yet, WAFs have high false positive rates.

5. All that kludgly processing is a security weakness. WAFs tend to be closed source behemoths written in low-level languages.

Re:Ask HN: Does Cloudflare block HN comments if you have cod... by d0mine on Sunday January 14, 2024 @02:37PM (#38993663)
There are many valid points. Though it doesn't cover many things modern wafs systems do in addition to the regex rules.

The question what is the alternative and the suggested alternative is that everyone become perfect security expert. It is even less likely to succeed than creating security-aimed software by professionals.

Consider what is the proportion of sites that are created by people who knows zero about security. Wordpress is like on 40%+ web sites (ridiculous).

WAFs unlikely to prevent targeted attacks, they don't have to to be useful. In practice, simple measures can prevent many common attacks.

Re:Ask HN: Does Cloudflare block HN comments if you have cod... by oars on Sunday January 14, 2024 @03:58PM (#38994375)
Interesting article about whether WAFs are actually useful or not in modern times. Thanks!
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by whodev on Tuesday January 16, 2024 @11:14AM (#39015019)
I was kinda with you until you made this statement: > No, "defense in depth" is not a valid excuse to use a WAF anyway, because it provides no real defense!

I have to disagree here. You are making assumptions that every developer in an org will always do the correct thing and deploy code that won't be exploitable to SQL injections, XSS, file inclusion, etc... That's just not the case. I'm all for doing the correct thing, and not just performing security theater, but WAFs do offer some protection. You need multiple layers of security covering the holes that may left in other layers. And a WAF can be one of those layers of protection.

Re:Ask HN: Does Cloudflare block HN comments if you have cod... by cheekibreeki2 on Sunday January 14, 2024 @09:49AM (#38990878)
Have you ever tried to run mod_security? You sound like you've never been in the trenches.
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by donatj on Sunday January 14, 2024 @10:40AM (#38991371)
Corporate recently pushed us into using a WAF. It has been nothing but a PITA
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by terom on Sunday January 14, 2024 @01:44PM (#38993144)
Easy: just set up the WAF but with an empty ruleset.
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by andrewaylett on Sunday January 14, 2024 @11:43AM (#38991941)
Honestly, so many of these complaints about web application firewalls fly so far past the point that I'm not surprised folk don't understand them.

Yes, they can be trivial to bypass. And yes, they don't block everything. But also, yes, they can be very useful in some situations.

My employer's security team maintains a WAF, and while it may be frustrating at times (like when anti-directory-traversal rules broke page names with '...' in them) I mostly prefer that they continue to do so for two big reasons: script kiddies and botnets.

It doesn't matter that a bypass is trivial when in practice your attacker won't mutate their attack -- if the attacker was more sophisticated, the defence could be too, but if the attack is dumb then there's no point in a sophisticated defence.

Botnets mean that purely reputation-based defence is insufficient. The best defence to a distributed attack is one that's really cheap to evaluate. If all an attacker ever tries is to hit our homepage with a fixed user agent string, then all we need to do is block that UA from hitting our home page. A simple WAF entry is sufficient to block that particular attacker.

This precise example is indeed poorly-applied, as the system is intended to receive arbitrary text of arbitrary technical complexity. But I wouldn't mind the rule being applied to my team's endpoints, as we can be confident that anyone sending shell has malicious intent regardless of whether there's any chance that my services would try to execute the code (they won't).

So long as it is possible to bring down services without any effort, skiddies will keep trying to do that. And so long as we've people trying dumb attacks in infrastructure, dumb defences can have a worthwhile effect. And if the dumb defences start catching stuff they're not supposed to catch, like the example with '...', they're dumb enough that we can understand why they're doing that and if we can safely turn them off.

Re:Ask HN: Does Cloudflare block HN comments if you have cod... by sixhobbits on Sunday January 14, 2024 @03:40AM (#38988614)
Test

`nc 192.168.2.100`

Re:Ask HN: Does Cloudflare block HN comments if you have cod... by rstuart4133 on Sunday January 14, 2024 @05:50PM (#38995255)
There is no need to do that here. Putting the text into the 'About:' box of your HN profile works just as well while not cluttering up the thread.
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by buro9 on Sunday January 14, 2024 @03:47AM (#38988640)
Probably, the WAF, specifically Cloudflare specials, matches a number of things. And as a lot of it is just regex matching the context of where the match occurs isn't precise.

Additionally cloudflare doesn't know what is safe for a given site, so it has to be a little conservative. The sites that can handle malicious input, or are tech sites that expect things that are SQL or commands that may contain directory traversal, these are in the minority.

Essentially these are false positives, which are typically viewed as more acceptable than false negatives as those would allow attacks through.

These things are configurable by the site owners, but the issue here is that the site owners are not shown the code of the rules, so have to guess from the names and descriptions whether something is safe to disable, meaning everyone just leaves everything enabled. Usually reporting this to a site owner with the cloudflare trace id is sufficient to enable the site owner to disable a rule that is causing false positives, as the site owner can use the cloudflare dashboard to search the trace id.

I do not work there any longer (left 3 years ago), but did write significant parts of the firewall and also manage the firewall, WAF, and DDoS protection teams.

Re:Ask HN: Does Cloudflare block HN comments if you have cod... by kxrm on Sunday January 14, 2024 @05:18AM (#38989150)
Apparently you can get around it using other white-space characters, here I am using a horizontal tab between nc and the IP.

    nc 192.168.1.100 8000
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by cwillu on Sunday January 14, 2024 @05:41AM (#38989255)
For reference, the id in the block message is “Cloudflare Ray ID: 845543eb88d461ee”
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by ifeja on Sunday January 14, 2024 @07:08AM (#38989705)
nc domain.com
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by 6865 on Sunday January 14, 2024 @07:53AM (#38989990)
aoeaoe
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by kevincox on Sunday January 14, 2024 @09:05AM (#38990476)
I'm sure that there is a huge chart on their Cloudflare dashboard about how many attacks were blocked! This is one thing that gets me, all of the reporting Cloudflare provides treats every block as a huge success. Nothing to help identify actually attacks vs false positives. Let also false positives that would have actually has a negative effect on the application behind the WAF.
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by deno on Sunday January 14, 2024 @09:40AM (#38990810)
Cloudflare is just dumb, they block XHR requests randomly in the same session they’ve already challenged breaking websites in not quite obvious ways and have been doing that for as long as I can remember. Trying to do anything on for example Montana's SOS BIZ portal takes a lot of patience. They’re like TSA of the Internet but at least with TSA you can pay for a fast pass.
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by ForestCritter on Sunday January 14, 2024 @12:13PM (#38992192)
cloudflare blocked me from signing in to my petflow account to buy cat food. It was in an endless verification loop. Awhile back it did the same with my paid crunchyroll subscription. I don't code, I have a very ordinary setup with a well known browser. Apparently cloudflare now owns our access to the internet and can block whom it pleases, when it pleases, no recourse. The internet is soon to be available only to those who fit cloudflare's criteria, whatever that may be, as long as companies keep buying in to the third party control.
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by 1vuio0pswjnm7 on Sunday January 14, 2024 @03:10PM (#38993973)
"If you're seeing this message, that means JavaScript has been disabled on your browser, please enable JS to make Imgur work."

Well, it's a client that has no Javascript engine.

There is no need to use Javascript. This works for me just fine:

https://i.imgur.com/YtepoDbh.jpg

Re:Ask HN: Does Cloudflare block HN comments if you have cod... by EasyMark on Sunday January 14, 2024 @10:34PM (#38997186)
ever since imgur started hating VPN users, I hate it back.
Re:Ask HN: Does Cloudflare block HN comments if you have cod... by flexagoon on Monday January 15, 2024 @05:44PM (#39007073)
You can use Rimgo, an alternative frontend for Imgur

Just replace "i.imgur.com" with one of the Rimgo instances:

https://rimgo.codeberg.page/

(The most popular ones are usually rate-limited though)

Re:Ask HN: Does Cloudflare block HN comments if you have cod... by Am4TIfIsER0ppos on Monday January 15, 2024 @05:30AM (#38999269)
How can Cloudflare be reading anything you send? Your connection is encrypted to HN's server, is it not? They don't MITM everyone's connection.