418 I'm a teapot
developer.mozilla.org
developer.mozilla.org
I started responding with 418 "You are a tea kettle" or something like that to those specific requests. The originating dev actually paid attention to their error messages and quickly resolved their config issue.
Fast forward to March this year. Some fucking numb nuts a-hole decided to add jsonip.com to an EXTREMELY widely used version of Dalvik/Android software that gets deployed to hundreds of thousands or millions of devices.
Overnight my traffic levels increased by 300%. I'm a solo dev offering a free service for 12 years. That kind of increase in traffic costs me money I've never had to plan for.
I ended up switching to Cloudeflare to handle the load with a WAF filter on the offending android tvs and other devices.
However Cloudflare doesn't properly route ipv4 address because "ipv6 is cool so we only do that" or something. Despite numerous support requests, that's still shmaybe an enterprise level feature.
I apologize to any long time users of the service. This was completely unexpected after more than a decade. I've been trying different "fixes" for 2 months and have not resolved a way to block this garbage traffic and still provide the original services.
Yea sorry I turned this funny old internet post about the mit coffee pot into a thing happening to me.
But if for some ungodly reason you're the dev or know who did it, REMOVE MY SERVICE ADDRESS FROM YOUR OUT OF DATE FROM TV/SMART DEVICE ANDROID code. You're literally fucking killing me. I've literally spend dozens of hours trying to find out if this was a contribution to a public source repo. Nothing.
Based on the Dalvik user agent, I only found a handful of references in Chinese repos. But google search is so terrible these days, even those are false flags.
So I have no idea who to contact about this. Some dipshit on your team(s) decided to abuse a free service as though there isn't a single human person behind it absorbing the costs and making sure it runs.
Obligatory https://xkcd.com/2347/
- return a 200 with broken JSON, possibly triggering parse errors or exceptions in the caller
- return a payload that generates catastrophic resource consumption on the other end, e.g Content-Encoding: gzip and feed it a deflate bomb
- hack TCP and/or TLS to leave the other end waiting/stalling in an attempt to rate limit (timeout) or starve resources (ulimit) on the other end (e.g abuse 3 way handshake)
That said, it seems like a _single_ actor is causing 300% cost increase compared to _every other actor combined_. Even if advertised as free, there's decency to be had.
If I lend someone my home without TOS and say "make yourself at home" there's a reasonable common sense expectation from both parties that visitors should not turn on every water tap and electric device full blast 24/7, because that would be damaging to me in the first place.
Given the scale of the purported app causing this it's very much abuse in its own right, whether intentional, misengineering, or an oversight. The author of jsonip.com seems to have taken every precautionary measure to limit damage and identify perpetrators to reach out, and these failed. Ethically I feel it would be only fair to displace damage from their infra to the app in order to protect themselves. The only alternative is to shutter the service as it's essentially experiencing a financial DDoS.
Your logic error is in assuming all people have common sense and setting expectations based on that assumption.
This actually has nothing to do with common sense, a jr and sometimes even senior mobile devs would not have the mindset of avoiding a ddos to a third party api when writing a feature that needs to get the device ip. It wouldn't be on purpose, it would just be that they don't know that they don't know yet. These issues of slamming a backend server are pretty common and mobile devs don't know to avoid it until they cause it imo. This could also be malware too which wouldn't care about decency.
Point is, scale your service, adjust your terms, start rate limiting, or shut it down. Calling your users names is the wrong solution no matter the user's intent, and solves exactly zero of the issues at hand.
The service owner should feel proud to have such a popular service, many folks will never have to deal with scaling issues. As the saying goes "scaling issues are good issues to have".
True, but returning fire with malformed responses or other such tactics could absolutely solve:
> assuming all people have common sense
.. sometimes effective communication starts by doing what you have to IOT get someone’s attention.
Scaling is done entirely at the expense of the service provider, so, not a sustainable option (and AIUI already done so as to continue serving for other users, but at terrible cost). Scaling issues are good to have when you have customers, not when you personally foot the bill.
> adjust your terms
At the very least changing terms won't change the already deployed app instances. In each of the three delineated scenarios it won't even register a blip on the abuser radar. So, not an option.
> start rate limiting
Pretty sure that was attempted. This is DDoS, rate limiting means doing it across the board, impacting every user, including those in good standing.
> or shut it down.
The only effective option. a.k.a the nuclear option a.k.a We Can't Have Nice Things.
> get someone's attention
That's the end game of these gray tactics. Not wreaking havoc but triggering awareness in a last resort way so that dialog can be opened/corrective measures can be taken. Note that "shut it down" would presumably have a similar effect, so there's no real harm done in practice.
> Supports unlimited requests and is free.
Maybe update that text? There is no guidance on acceptable thresholds, rate limits, etc.
This is different. Someone wasn't thinking and randomly added the domain to a lazy piece of code somewhere that got deployed to millions of devices pretty much over night. The only way I've been able to keep jsonip active is by incorporating Cloudflare. But they don't actually solve the problem. As a corporation, they treat ipv4 addresses like 3rd class citizens.
Anyway yeah I've been evaluating changing the TOS, requiring registered signins, etc. But NONE of those fixes a 300% level of traffic that's been hitting the service for months now. I can change the verbiage all I want. But it does absolutely nothing to stop the a-hole dev from China or wherever that rolled out an update to hundreds of thousands of millions of devices with simply emailing me if that's ok.
I've literally, and successfully, run the service for free to the public because no one has done this before.
And to the nginx people. No, returning 444 doesn't seem to fix the problem. I've tried. It doesn't work.
[0] https://en.wikipedia.org/wiki/1989_Tiananmen_Square_protests...
Love it.
> Supports unlimited requests and is free.
Typically "unlimited" is more than a million.
If you lie in your marketing material then you may put yourself in a mess. Big surprise.
If your audience is millions of users it’s millions * millions, not cool.
That's pretty crazy viewpoint.
Yes.
> That's pretty crazy viewpoint.
Companies that make millions of devices while abusing free APIs without giving anything back are assholes. Hmm, let me think?
No, it’s not.
Saying that someone is an asshole for using an API in a way which clearly should be possible according to the documentation is a very clear sign of that person being a junior developer who don't have actual real world experience of anything except toy projects. Any developer with some years of experience would understand that this would happen and he should not be surprised over it.
It's very possible that no one involved in this is even aware of this issue, so automatically calling them assholes is somewhat incompetent at best.
If a service is free & "unlimited" and they start using it, and you get mad, then that is not their fault, it's yours.
No, effectively DDOS-ing a service just because it says it's free and unlimited is a dick move
People like those are a big reason for why we can't have nice things
Personally I would never rely on a service like this since it's 100% obvious it would be sudpectible to junior developers misunderstanding what is reasonable usage.
If you're putting up an API assuming all consumers will consume it in some limited and reasonable way, then you need to rethink things a bit.
What does this sentence even mean lmao
Autism-level consideration for what one says or not, if you say something is unlimited I'm going to take your word for it. If it's limited, tell me the limits. If it's free to a point, tell me the point. If I need to bust out the CC, tell me I need to bust out the CC.
Don't say your thing is free and unlimited if you can't handle unlimited traffic for free..
Hacker News would be on the complete opposite end of the anger scale if this was an ISP telling their users they can't actually use the "unlimited" they promised, haha
>if you say something is unlimited I'm going to take your word for it
The sentence refers to people like you. It doesn't make you incredibly clever to consider those sentences literally, like small children or those with under-developed empathy and theory of mind often do
It just makes you an inconsiderate numpty
>Hacker News would be on the complete opposite
Yes, there are lots of people on the tech scene that just don't get ideas like "don't abuse it", or "considering the consequences for other people"
Got to love the cleverness with the people who design services with the assumption that there are no such people and then goes on to hackernews and cries when a kid in China breaks their site. Lol.
Insanely incompetent.
It's not abuse if you say it's free and unlimited and someone uses it freely and unlimitedly! This is why sites have acceptable use policies and terms of service. This is why most sites don't say their tool is free and unlimited.
It is what those words mean. It is literal. If I read an acceptable use policy and then went on to use it in a way that is not allowed that would be silly.
> The sentence refers to people like you
> It just makes you an inconsiderate numpty
Speaking of "like small children or those with under-developed empathy and theory of mind", I'm not sure these were needed. Can we just discuss things? I promise my mind is open whether you insult it or not, I'm just not convinced by the argument at this point :)
I hope you got a nice slither of dopamine out of namecalling though in any case, haha
>I'm not sure these were needed
The original wording I was gonna use before deciding to be more considerate was "small children and autists"
If you can think of another short descriptor for "people who obtusely take things literally and are unable or refuse to account for other people's state of mind", I'm happy to use those instead
>I hope you got a nice slither of dopamine out of namecalling though in any case
In fact, it was far more than a sliver!
Upon further reflection, I think I got a lot of repressed anger for never having smacked people who can't behave unless they are explicitly told to do so, who actually need the "within reason" clause everywhere, and who are happy to play with technicalities when it comes to justifying their behaviour
I dunno if my mind is changed just yet but if I'm honest with myself adding it to a widely deployed app would be in my 'dick move' category.
Just set your own up, or use a DNS method which comes with the bonus of built in caching.
For what it's worth I've never actually taken anyone up on their unlimited offers, I try to keep my services neat and tidy :)
Besides that, odds are that this is malware of some sort hitting this service to get the infected device's public ip to phone it home for use in a command and control situation, and if so, they don't care that they are slamming this service.
Mobile devs who care about this type of thing will not need to make any sort of outbound connection anywhere to get the device ip address, it's right on the device already. These what's my ip sites are used by script kiddies and malicious software running on anything
"There's always an individual with autism-level consideration for what one says, isn't there?" isn't needed and I'd advise you to be more professional, or at least more human.
However, would you still call it "detached from real life" if suddenly the manager from McDonalds starts showing up daily, filling a 100-gallon drum with ketchup because it is "free"? In law there is such a concept as a "reasonable person", which exists precisely to avoid people abusing loopholes like this.
It's quite possible that a random just contracted to write software for some embedded system, with no context how many thousands or millions of devices it would run on. So they looked up OP's site, sees "supports unlimited requests and is free", shrugs and just writes implements the code.
Or, the dev might be told the system only had a couple thousand users, then somebody else copied the code and deployed it on a million devices.
You don't know the story, and I think the moral here is not to blame a faceless Android dev from China, but to implement quotas and controls and avoid falsely boast on your website that your service has unlimited scalability.
Don't get me wrong, you're doing the world a service with your service, but why should cloudflare have to handle your problem for free? If you want to resolve your problem, it sounds like it's in your hands - block traffic, or us something like cloudflare/waf. It's not fair that you have to eat the cost, but it's not fair that someone else does either.
If it's malware, they don't care if it's ok, they are malware authors. Contact your hosting provider which 100% has the ability to offload traffic from malware and ddos. They are responsible for the network and will not want malicious traffic anywhere on it, esp if it's tying up bandwidth for paying customers or premium bandwidth. If it was a large amount of bandwidth they would have contacted you long before you contacted them. I'd still reach out, they will move on it quick if it's an issue, and at the least can examine the traffic to determine if it's bad or not.
Cloudflare won't do much good here no? The requests still have to proxy back to your origin servers to spit back the ip. You can't utilize any caching on cloudflare due to the unique ip of each client. Their ddos prevention might not help because these are clients each with their own unique ip address, which is probably a cellular provider's ip space and not bad traffic. If it's the volume of clients hitting you, and not the volume of requests they make, it wouldn't trip cloudflare, or they'd be blocking major cellular address space across their entire network (which is a large portion of the internet these days)
We had to deal with image scrapers who didn't respond to requests to stop, even if we provided an API service. I configured nginx to just serve them images of a beaver and a few 1GB junk files, they stopped pretty quickly.
I do agree with one of the other comments - returning something about Taiwan or Tiannenmen square may do the trick
Do not serve it to assholes?
You mean, like they say they have been trying to do, in the complaint?
Person has a valid complaint, goddamnit, they have all the rights to complain.
Yes he can complain, and bombarding a free service for unlimited requests isn't okay.
For starters because the people doing that, will usually be among the first to cry when the free service stops being free, blocks their requests or suddenly requires an API key.
Hummmm.... OP's website on https://getjsonip.com/ says:
> Supports unlimited requests and is free.
Seems like we have a bit of a contradiction here.
There is a difference between gracefully and responsibly using something that is offered for free, and just bombarding it with requests like no tomorrow.
People can of course do the latter. But then they don't get to complain when at some point, the available offerings present walls of legalese instead of a few simple and clear statements, and the user experience goes from seamless and easy to "Click here to register an API Key"
One thing is to own a service that's used by 10 MAU and you extend the service with a job that calls the OP's service 100 times a second. That's bad, you are using way more than you need.
Another thing is to own a mobile app used by 10M MAU and you embed the OP's service into the app. That's not bad intention, you just added a new service to your app. The problem is that the OP's definition of "unlimited" is not really unlimited.
There's something about reasonability and fair-use and use over time going on here, but I just can't put my finger on it.
For example here's the Backblaze team verifying that their unlimited personal backup is indeed unlimited, with one single user storing 430TB for $6/month. The users spending $6/month who use a couple GB more than offset the cost of the 430TB guy. If your business model doesn't support the ability to get in the black, you have a failing business. This isn't the user's responsibility to fix, it's the failing service with a bad business model.
> As you can see, we lose money on a few customers at the high end (we cannot store 430TB of data for only $6/month), but since more customers just want to be reasonable and backup their laptops we are profitable and fully sustainable on the "average"
> Somebody who is costing Backblaze $2,150/month and is only paying $6/month :-)
https://www.reddit.com/r/IAmA/comments/b6lbew/comment/ejlbsq...
No difference here.
But here, you are actually taking resources from the author. That's something that is not only rude, but also puts the user at risk. The author is really nice for maintaining service, he could have just stopped it, or even served malicious payloads. After all, there is no contract saying that he should be nice. Here, despite the strong language, he is trying to stay nice instead of just cutting a service that many people rely on, which he has all right to do.
Throttling and daily query limits would make the service unreliable and not so different from cutting it off completely. Keep in mind that it is not a single user abusing the service, it is many users who got redirected there by an abusive app. He could have used the "API key" that is suggested here, but it is a hurdle that will affect usability.
Take a look at https://major.io/2021/06/06/a-new-future-for-icanhazip/, if you haven't seen it already.
Fyi, dns can be used to obtain public ip from large companies, without the overhead of tcp and http
dig +short txt ch whoami.cloudflare @1.0.0.1
dig +short txt o-o.myaddr.l.google.com @ns1.google.com
dig +short myip.opendns.com @resolver1.opendns.com
You should put it behind a CAPTCHA of some sort however, otherwise, some smartass will just write a "library" auto-fetching an api key as soon as the one it has currently cached stops working.
And yes, that is an annoyance to users, but so what? Please direct all complaints to the comparatively small number of people responsible for the fact that the rest of us cannot have nice things.
IMHO, one of the problems is that many dev. don't realize both the size of their company and the impact of so many requests.
I hop you'll find a solution, and thank you for your service!
PS: maybe you should create a dedicated post about this subject to attract visibility
[1]: Wikimedia Phabricator link: https://phabricator.wikimedia.org/T273741
[2]: HackerNews thread: https://news.ycombinator.com/item?id=26072025
This matches my experience. I'd use the CF free plan assuming no guarantees for a low risk site like my personal site, and I'd use the expensive enterprise plan where I'm paying individually for features and quota, but I'd never use the middle-ground "sure it's unlimited!" plan – it's far too vague about what it _actually_ provides.
Wow, that's crazy.
Literally being killed? Call the police!!!11
Going further with jsonip Plus
With the upcoming Plus service, you get special features and
even more information about your users.
- All of the free service features
- IP geo location - Country and city to within best available accuracy
- ISP Info
- Time zone data
- Full referer data
- Browser and OS info
https://web.archive.org/web/20200811215649/https://getjsonip...A paid service has been "upcoming" since at least August 2020, which would subsidize the free tier usage you allow on your site. Aside from the ISP and geo data, everything else is given to you in the request headers or can be determined with the ip address (geo can get tz).
If it's costing you money, shipping the Plus features might offset your out of pocket expenses.
This is a failure of growth/capacity planning and lack of a proper TOS that clarifies "unlimited within reason and at our sole discretion with no SLA or warranty of any kind for non-paying users", as well as failure to ship any monetizing features 3 years after announcing it.
Contacting them to have them stop wouldn't solve your problems. What happens when the next million devices get random updates from literally anybody that starts doing it again? Try to implement rate limiting, optimize your hot code paths, watch out for slow clients (buffered reverse proxies), needless header parsing, slow template rendering, etc. Any language capable of concurrency should be able to handle 100s of thousands of requests on a cheap vm. The client ip is coming to you in the request headers and all you do is print it back to them... A go handler would be a few lines of code to do this and that's including dealing with reverse proxy real-ip type stuff. You don't need to allocate an actual struct and serialize into a json object, just printf a hardcoded string with a replacement for the ip from the header, or better yet benchmark the fastest solution.
I'll do it for you, I'm looking for a job ;)
Or better yet update the TOS to be free and unlimited for non-commercial use, and to contact sales for commercial use with an estimate of request volume, then sign a phat enterprise contract and rest easy
Any free service that has utility will be quickly scripted against and used to make someone else money. Build accordingly
Personally I would deep dive the traffic and try to determine the intent behind it, you could be destroying a future generation's potential, and not blocking malware I'm assuming you can correlate the requests from those ips with that they are translating. Odds are someone is hitting your service to translate for their paid service, but if it's an important part of a poor country, I'd find a way to allow it to keep happening
> AFAIK we couldn't see translation requests from them, just loading our website.
Browser homepage? Or maybe the unlucky victim of a "connectivity check/am I online" recurring task
Now it's a headache for a different reason.
cat /etc/hosts |grep -i 'jsonip.com'
0.0.0.0 jsonip.com
0.0.0.0 www.jsonip.com“However Cloudflare doesn't properly route ipv4 address because "ipv6 is cool so we only do that" or something. Despite numerous support requests, that's still shmaybe an enterprise level feature.”
jgc@cloudflare.com if you can share your interactions with us.
1. Check your competitors who return json and see if they have a Location header 301'ing or 302'ing all their traffic to your service (if the client follows redirects).
2. Reverse dns lookup your origin ips and see if anyone has a domain's dns pointed at your service. Check the Host header on your end and make sure it's your domain as well as ensure your web server and/or proxy are not blindly accepting traffic for `*`/any host, and make sure it's serving only your host
3. Ip address headers can be spoofed. It might not be coming from where you think it's coming from
edit: a common one for me is that if any test passes a post request without a csrf token... sorry, I'm a teapot, because I forgot to add a csrf token to that form.
It’s just my general “something particularly odd has happened” response.
It's a bit of a purist argument, but 4xx series means the client can fix something and get a better response.
It is true I have often encountered inconsistencies in implementations but I do think that when that happens it really is a backend bug that should be fixed.
I am not sure about the other two though.
413 definitely does not seem retryable, if the client continues sending too large content. Special handling would be needed to break down the data into smaller chunks and when I encounter this error I just break it down to smaller chunks beforehand so built-in handling is not needed.
Never encountered 408. It might be because I never keep connections too long...
But nobody enjoys a 500 so I occasionally use 418 for extra unexpected situations.
It also works perfectly in case it accidentally gets pushed to production.
return "this error, blah", 418
I understand your point, and it's a good one. I really don't need to use 418, I just find it useful. I think the key is that when I see that 418 error, I know it's something I put in there at once.
I also think a naked 418 is a bit cleaner if it did end up on my production server, just because I'm not tipping my hat too much by returning anything about what's happening behind the scenes.
It could be a lot cleaner if I did everything by the book, but where I use this is just my hobby project, and I'm just going for doing as much as I can quickly, and the mental energy that goes into error handling could easily add very significant time. Again, you're not wrong, and it would be better if i clearly articulated these errors in the long run.
Is this the one that gets sent if the server temperature rises above 80 deg?
I remember being at a training course that day and my manager asking me what we could do to fix it because our CI was failing to pull dependencies from NPM.
Trying to explain that NPM was returning a status code intended as an April Fools joke and which was never meant to see the light of production was quite difficult
Perhaps I can fix a lot of things but debugging a response code that isn't meant to exist is not one of them.
https://search.censys.io/search?resource=hosts&q=services.ht...
I'm looking forward to the extended protocol Sugar bowl.. A parody of 'I'm a Little Teapot' : https://en.wikipedia.org/wiki/I'm_a_Little_Teapot
'I'm a little teapot short and stout... here is my handle... here is my handle... Oh fv<k!, I'm a sugar bowl'
Protect the code!
Started off as an April's fools joke, people liked it enough to keep it in.
> “It's a reminder that the underlying processes of computers are still made by humans”
Nope, it's still funny, we're keeping it.
This makes it similar to 405 Method Not Allowed, 406 Not Acceptable, or 426 Upgrade Required.
> the server cannot or will not process the request due to something that is perceived to be a client error (for example, malformed request syntax, invalid request message framing, or deceptive request routing).
https://github.com/3digitdev/Haiku-TTP-Codes
Doesn’t have any for 418 yet though… a PR may be in order!
I also return a teapot emoji as the response body.
Building integrations for duct-taped legacy systems in finance is fun.
Not saying such a feature is needed just wondering could it be useful for some purpose.
Perhaps a unique status-code of a server could identify things like the version of content served by it.
curl https://news.ycombinator.com/ | base64