Skip to content

Fetching and extraction

Outcome: you understand what happens between pasting an address and seeing an article — including the lab's refused fetch, why it was refused, and what a failed extraction leaves behind.

The fetch, step by step

  1. Wallabag hands the address to its HTTP client, which passes it through a server-side request forgery (SSRF) protection filter before any request is made.
  2. The fetcher downloads the page, following redirects.
  3. The extractor parses the HTML, looks for a site configuration — per-site rules, shipped for thousands of known sites — and otherwise applies its general readability rules.
  4. The result — title, body, language, reading time — is stored on the entry, together with the HTTP status of the fetch.

The refusal the lab met first

The lab's first save of its fixture article produced this entry (transcript wallabag-lab/transcripts/t02-fetch-blocked-by-ssrf.txt):

[title] => No title found
[http_status] => 500
[content] => wallabag can't retrieve contents for this article. ...

The fetcher's own log named the cause:

Provided port "19089" doesn't match whitelisted values: 80, 443, 8080

The SSRF filter in the stock release (vendor package j0k3r/httplug-ssrf-plugin) whitelists only ports 80, 443, and 8080 for fetched pages, and blacklists private address ranges, including 127.0.0.0/8 (loopback), 10.0.0.0/8, and 192.168.0.0/16. This is a security feature working as designed: a Wallabag server that fetches any address its users paste must not be usable to probe the network it sits on. A test page on your own machine is exactly what it refuses.

The lab-only adjustment, stated plainly

To let the lab's Wallabag fetch the lab's own fixture page — and only for that — the lab patched two defaults in its scratch copy of the vendor file vendor/j0k3r/httplug-ssrf-plugin/src/Options.php: port 19089 was added to the port whitelist, and 127.0.0.0/8 was removed from the IP blacklist. The diff is two lines and is recorded in transcript t02's notes and in the lab folder. No Wallabag application code was changed, and a real installation should not carry this patch: it opens precisely the door the filter exists to close. With it, the same save returned status 200 and the full extracted article (chapter 4).

The lesson generalises. On the public web — articles on ordinary sites, on ordinary ports — saves proceed without any of this. On an intranet, a home-lab server, or any non-standard port, Wallabag will refuse, and the refusal is the product telling the truth about its security model.

When extraction itself fails

A page can be fetched and still extract badly: scripts that build the article after loading, paywalls that return a teaser, layouts the general rules misjudge. The entry is saved anyway, holding whatever was found — sometimes just the title and a paragraph of navigation text. Wallabag offers a re-fetch action on the entry, and per-site configurations fix many known sites; both are partial answers. Chapter 1's rule is the whole answer: the archive holds what the extraction got, including the miss.

Check: save a page, then look at its entry's stored status. If you can tell a 200-with-article from a saved failure, and say which part — filter, fetcher, or extractor — produced each, you have this chapter.