Webmention-brainstormingMain article: Webmention
Brainstormingusing x-forwarded-for to mitigate DDoS abuseWhen verifying a webmention by checking the source site, include an X-Forwarded-For HTTP header in your request, with the value set to the IP address of the client that notified your server of the alleged webmention. That is, to verify, do something like: curl -H "X-Forwarded-For:$sender_ip" $source where For more, see DDOS#Forward_originating_IP_address. Note: WordPress is using X-Pingback-Forwarded-For to mitigate abuse of pingbacks. And IETF is also in process of standardizing a Forwarded header (with a more detailed semantics). If someone feels strongly, we could pick one of those or mint something new, but in the meantime, use X-Forwarded-For. Asynchronous status pollingAsynchronous status polling could be achieved via the webmention receiver returning a LINK header with rel=status with a URL for querying the status of a specific pending webmention request. Example: LINK: <http://example.com/m/10> ; rel="status" Then the sending of the webmention could poll that URL for updates on the status of that particular webmention.
Status Query ResultsIn order to distinguish between the layers of a request to the status page and the actual current status of the webmention, the page could return an additional header to explain that status of the webmention processing. This could be the same code that would have been returned if the webmention were just submitted. Example: HTTP/1.1 200 OK Webmention-Status: 202 This would say that the webmention is still in the state of "accepted" but has not processed yet. This also leaves the page body open to any formatting for the user's view. ImplementationsIndieWeb community members who have implemented this
Asynchronous status notificationAsynchronous status notification could be achieved by using a webhook in the initial webmention request. I.e. in addition to:
add:
to the webmention POST request. Webmention receivers should optionally support the "callback" parameter by calling it back (doing an HTTP POST to it) upon completion of processing of the webmention, with a "status" query parameter indicating the outcome of webmention processing. See "More status codes" below for possible values for that parameter. Example payload sent to the callback URL: source=URL& target=URL& status=200
Variable Response Body ProblemTo deal with the variable response body problem:
propagation to a mobile deviceTo make webmentions more useful, it would be great if there was some way to have them propagate as notifications to whatever devices the user has setup to receive such notifications. homepage webmentionsIt is possible you may want a separate webmention endpoint to handle homepage webmentions See: homepage: webmention to homepage. retrying/error handlingGood retry logic can be hard, regardless of what you're doing, and webmentions are no exception. Here are some current practices we use to retry HTTP fetches for webmention endpoint discovery, sending webmentions, and fetching source pages to check backlinks.
rate-limitingA webmention endpoint getting too many requests, potentially from a single source, should be able to communicate this to senders, asking them to retry later. (note that it might be necessary to rediscover the endpoint, maybe comparable to caching) If a single sender is sending to many requests, HTTP 429 (Too Many Requests) seems like the apropriate response. In other cases, HTTP 503 (Service Unavailable) can be used to signal temporary failure. Both allow a Retry-After header to give a hint when new submissions are accepted.
The webmention specification currently doesn't mention how responses other than 400 & 500 should be treated. For senders that are directly triggered by a user that can not retry later automatically, it might make sense to displays those temporary errors differently to the user than more permanent errors (like a missing WM endpoint), prompting them to retry manually later. Endpoint By Page on Same DomainPages that do not support webmentions should not advertise an endpoint, even if the domain in general does. proof-of-workWebmention spam is not (at time of writing) really a problem; it'd be nice to keep it that way. A proposal: add a hashcash-like "proof of work" to a webmention request. In essence, this is a calculation which takes a little time to do; not enough to impact an individual sender, but enough to make large-scale webmention-sending (i.e., spam) problematic. epoch hashingProposed approach (suggestions from crypto people are welcome!) In addition to source=http://source/article&target=http://target/whatever POST parameters to the webmention endpoint, also pass two new parameters: time=1417292519&nonce=5684712. The time parameter is UTC epoch time (seconds since 1970), and the nonce is calculated such that sha256(target + "-" + time + "-" + nonce).hexdigest() startswith "000000". The number of zeroes required can be varied before specifying this approach to "tune" the difficulty of creating a nonce; the above (6 zeroes) takes some seconds on a reasonably modern machine. A webmention endpoint then checks that sha256(target + "-" + time_parameter + "-" + nonce).hexdigest() really does start with "000000", and that time is not too long ago (to prevent replay attacks; "not too long ago" is intentionally vague here because one must consider clock drift and so on). hashcash-for-vouchesPossible alternative: set up hashcash-for-vouches.com where one submits the proof of work to h-f-c.com and if it verifies, h-f-c then vouches for you as per Vouch. What should then happen is that if people generally agree that h-f-c is requiring a proper proof-of-work, everyone whitelists it. So it's all done on the back of Vouch, but it doesn't have Vouch's clique problem. A working implementation of this is at Hash for Vouch and described in detail there and on kryogenix.org. plain hashcashHashcash for Vouches seems like overengineering. Why not just attach a hashcash to the webmention itself? If you were sending a webmention from http://example.org/a to http://another.example.org/b, you'd take the target URL, calculate a hashcash for that URL, then send that as an extra parameter in the webmention. To specify the hashcash bit level, we could use a meta tag like this:
If you get a hashcashed webmention and you do support it:
If you get a hashcashed webmention and you don't support hashcash, simply ignore it. Performance testing: https://gist.github.com/tommorris/d57178fd02ee991e8c08 verifying private webmentionsIf you receive a webmention from a web page that requires authentication to access it, the normal webmention verification process will fail. What is the best way to have the webmention endpoint authenticate as the receiver's website to be able to fetch the private page? Main article: private-webmention
checking endpoint once per domain/caching the endpointCurrently the spec requires webmention discovery on every URL you want to send a webmention to. If your post links to three separate notes on the same website, for every webmention you need to check the note’s page to discover the correct endpoint even though these are likely to be the same. Would it be safe to assume only one endpoint per domain? (From IRC 2015-06-15.) Notes from related IRC discussion 2016-04-11:
AlternativesAlternatives to webmention. LINK verbJames Snell brings up a suggestion to use the HTTP LINK verb to send the webmention notification. This would remove the need to first make the discovery request to find the webmention endpoint, since it could immediately send the LINK request to the URL itself. Problems with LINK verb:
Because of the benefits and flexibility the discovery step adds, we need to stick with it and can't use the LINK verb as cool as that might be. http://aaronparecki.com/replies/2013/08/08/2/webmention IssuesDDOS attack vectorWebmention, like Pingback, is a vulnerable vector for DDOS attacks. See DDOS for more discussion and proposed solutions. 3rd party tracking exploitsThird party visitor tracking (or possible exploit) via nocache icons. See [4] for details.
client unsure can read responseNot specifying a required response format and/or structures of the response formats is problematic as a client can never be sure they’ll be able to read the response.
should bookmarks send webmentionsShould bookmarking (i.e. publishing a bookmark post) send a webmention? What if there are 1000's of bookmarks? how do you distinguish between normal links and bookmarks? - http://indiewebcamp.com/irc/2013-06-11#t1370966945
asynchronicityAsynchronicity: a server may want to queue webmentions for source retrieval processing and do that asynchronously with the request. It's not always practical or advisable to handle all that processing in the actual HTTP POST thread. Thus receivers of webmentions must not be required to return repeat webmentions not an errorUpdates: it's acceptable to send a repeat webmention, e.g. for updating or deleting comments. Thus the de-duplicationThis section likely deserves its own article, deduplication (canonical name per Wikipedia article [6]), since there is an IndieWeb example, a non-webmention silo example, and applicability to comments independent of notification mechanism (webmention). De-duplication (AKA de-duping deduping): replies and other responses are often duplicated in different places, e.g. via backfeed of POSSEd replies by Bridgy. Ideally, recipients should try to de-dupe webmention sources, preferring an original post (see below). Getting this perfect is hard, but getting close is pretty easy (see one IRC discussion and another) by comparing an incoming reply (etc) to existing replies based on:
Examples / challenges for de-duping (use these as source material to check any de-duping approaches / algorithms)
IndieWeb Examples:
Silo examples:
prefer original postsprefer original posts - an alternative to implementing de-duplication is to simply always prefer original posts (replies) rather than their POSSE copies. You can implement this by:
bad interpretation of h-feed source
Resolved Discussionsrel webmention addition to registry
rel-webmention on <a> tagsDoes it make sense to allow rel=webmention on anchor tags in addition to link tags?
These libraries and implementations support <a> webmention endpoint discovery
These webmention endpoints show human-friendly information, when visited with a GET request
More status codesSynchronous webmention receivers should return the following status codes:
Asynchronously: Similarly, in an asynchronous interaction, the callback webhook should include a "status" URL query parameter with the status codes noted above. |




















