News for hackers. Stuff that matters.
Re:What webhooks are and why you should care by nx on Tuesday February 10, 2009 @10:07AM (#475218)
Good thinking! I guess we'll have to devise some way to avoid these kinds of cycles, or limit them by setting some type of maximum number of bounces on a webhook message.
Re:What webhooks are and why you should care by tptacek on Tuesday February 10, 2009 @11:15AM (#475348)
How would you do that? The point here is, the webhook call can't really know what it's POST'ing to; all it takes to set up a loop is another web app that will itself formulate an arbitrary POST.
Re:What webhooks are and why you should care by Xichekolas on Tuesday February 10, 2009 @12:17PM (#475492)
Just keep track of a 'url stack' in the POST message (assuming the post body is structured with something like JSON or XML). If a service detects a cycle it can drop the message or give back a 50x error or something.
Re:What webhooks are and why you should care by tptacek on Tuesday February 10, 2009 @04:51PM (#476037)
The problem here is that you can aim a "web hook" at any other HTTP endpoint, which may or may not honor any "web hook loop avoidance" protocol you come up with, and if that endpoint re-triggers the activity that generated the hook update, you have a loop.

HTTP is stateless, so the "url stack" idea is going to be tricky to implement.

Re:What webhooks are and why you should care by Xichekolas on Wednesday February 11, 2009 @12:03AM (#476559)
Yeah I suppose keeping a trail of breadcrumbs only helps you prevent accidental loops. A malicious service in the chain could just clear the stack and create a loop, and no one would be any the wiser.
Re:What webhooks are and why you should care by kragen on Wednesday February 11, 2009 @10:58AM (#477141)
A malicious machine that wants to DoS a server doesn't need web hooks in order to make a bunch of requests to the server. It can just run ab, the Apache Benchmark program.
Re:What webhooks are and why you should care by Xichekolas on Wednesday February 11, 2009 @02:04PM (#477417)
Presumably DoSing wouldn't be the objective here. If some of your services in the loop send SMS messages or modify your checkbook register, that would be much more annoying than a simple DoS.
Re:What webhooks are and why you should care by nx on Tuesday February 10, 2009 @11:21AM (#475364)
Maybe delaying subsequent POSTs from the same server, unless it's whitelisted, and Bayesing out fishy requests. That should reduce the load.
Re:What webhooks are and why you should care by eli on Tuesday February 10, 2009 @11:12AM (#475340)
That would be pretty difficult -- the API message itself isn't getting passed around so there's no way to add a TTL.

If a blog post triggers a Tweet, and that Tweet triggers a blog post, which triggers another Tweet....

Re:What webhooks are and why you should care by olefoo on Tuesday February 10, 2009 @11:18AM (#475357)
Basic http caching and rate limiting should cover this.
Re:What webhooks are and why you should care by tptacek on Tuesday February 10, 2009 @11:20AM (#475361)
Unless it's hard to make new accounts, the best that rate limiting can do is disable the whole webhook service.
Re:What webhooks are and why you should care by olefoo on Tuesday February 10, 2009 @11:29AM (#475383)
Your web server can't issue a 305?

Your load balancer can't enforce usage limits?

Re:What webhooks are and why you should care by tptacek on Tuesday February 10, 2009 @04:49PM (#476033)
If adding new users is easy, then you don't have enough information to do targeted rate limiting.
Re:What webhooks are and why you should care by olefoo on Tuesday February 10, 2009 @09:37PM (#476404)
You are talking up the stack, users, sessions, etc. I'm talking about using controls at lower levels of the stack; basic ip-based bandwidth throttling, forcing all requests to pass through a proxy, and the like. If the business requires that users be able to point random postbots at their account you have to plan for misbehaving counterparties; and application level controls while important will not be sufficient to keep the system up in the face of a broken client that is spamming the server with oversized requests at a pace higher than it can accomodate.
Re:What webhooks are and why you should care by shader on Tuesday February 10, 2009 @09:48PM (#476417)
Even if you do low level throttling that maintains the stability of the system, it doesn't necessarily ensure usability. Who would want to use webhooks if there was much of a chance of frequently getting flooded by spam? It doesn't matter if the trickle isn't enough to kill your server, if you keep getting buzzed on your mobile every thirty seconds, you won't want to use the service any more.
Re:What webhooks are and why you should care by olefoo on Wednesday February 11, 2009 @12:06AM (#476566)
This problem has been relatively solved for email beforehand, every once in a while the spammers figure out something new or something goes awry and you have a few offers for male enhancement products in your inbox; do you stop using email because of it?
Re:What webhooks are and why you should care by tptacek on Wednesday February 11, 2009 @01:56AM (#476677)
The problem is solved for email because MTAs and mailing list programs go through contortions, documented in a long series of RFCs and Internet-Drafts, to avoid loops.