Live › vulnerability › CVE-2026-113671
Go to dashboardThe @apostrophecms/ai-helper npm package builds a server-side image fetch URL from the request Host header when no global base URL is configured, and its accept route has no permission check. An authenticated editor can therefore make the server send GET requests to any host and port they choose, reaching internal services the attacker cannot contact directly.
Summary written from the sources below. Check the originals before acting.
First seen by InfraStack 2026-10-23 19:11 UTC, 3h before NVD. All times on this page are UTC.
| Product | Ecosystem | Affected | Fixed in |
|---|---|---|---|
| @apostrophecms/ai-helper | npm | >= 1.0.0-beta.10, < 1.0.0-beta.13 | 1.0.0-beta.13 |
npm ls @apostrophecms/ai-helper in the project and check whether the version is >= 1.0.0-beta.10 and < 1.0.0-beta.131.0.0-beta.13 or later (fixed version per the advisory product data)Each row is the first time that source carried this signal. The analyst’s rows are its own findings.
The @apostrophecms/ai-helper package builds the URL for a server-side image fetch by resolving a storage-relative path against req.baseUrl. When the site does not set a global base URL (the default), req.baseUrl is derived from the incoming HTTP Host header. An authenticated editor can generate a base64 AI image (which is persisted without a stored url) and then send an unauthorized PATCH accept request with an attacker-chosen Host header. The server then issues an outbound GET to the attacker-selected origin, producing a Server-Side Request Forgery primitive that reaches hosts and ports the client cannot otherwise contact. The affected code lives in packages/ai-helper/modules/@apostrophecms/ai-helper-image/index.js.
The image accept route trusts req.baseUrl as a safe origin for constructing an internal fetch target, but req.baseUrl is attacker-influenced whenever the site has no configured base URL. The URL builder concatenates a default local storage path (which is relative, for example /uploads) and resolves it against req.baseUrl; because the left operand is relative, the resulting origin is taken entirely from req.baseUrl. Two protections that exist elsewhere are missing on this path: the generate route enforces an edit capability, but the accept route performs no authorization or ownership check, and no allowlist or validation constrains the resolved origin before the fetch.
packages/ai-helper/modules/@apostrophecms/ai-helper-image/index.js
aiHelperImageUrl (line 91-92): image.url || new URL(self.uploadfs.getUrl() + `/ai-helper-images/${image._id}.png`, req.baseUrl)
aiHelperFetchImage (line 64-65): fetch(self.aiHelperImageUrl(req, image))
apiRoutes.patch['ai-helper/:_id'] (line 314-333): findOne({ _id }) only; no permission or ownership check
packages/apostrophe/modules/@apostrophecms/i18n/index.js
setPrefixUrls (line 799-820): req.baseUrl falls back to `${req.protocol}://${host}`, host from the Host header when apos.baseUrl is unset
An attacker who holds a low-privileged editor account (the capability required to generate an AI image, which inserts a base64 record without a stored url and returns its identifier) can coerce the server into issuing outbound GET requests to an origin of their choosing by supplying a crafted Host header on the accept request. This yields SSRF: probing internal hosts and ports that are not reachable from the attacker's network position, and limited semi-blind exfiltration where an image-parseable response at the fixed path becomes a viewable attachment. The request path is fixed to /uploads/ai-helper-images/<id>.png, so only the origin (host, port, and http scheme) is attacker-controlled; arbitrary-path retrieval such as cloud metadata traversal is not reachable through this primitive. No integrity or availability primitive was demonstrated. Exploitation requires the default deployment where no global base URL is configured and local file storage is in use, together with a configured provider that returns base64 image data.
Preconditions:
- ApostropheCMS site with @apostrophecms/ai-helper installed and a configured
base64-returning image provider.
- No global base URL configured (apos.baseUrl unset), default local uploadfs.
- Attacker holds an account with edit capability on at least one content type.
POST /api/v1/@apostrophecms/image/ai-helper with body {"prompt":"x"}. The response contains the new record identifier <_id>. The persisted record has no url field.Host header:PATCH /api/v1/@apostrophecms/image/ai-helper/<_id> HTTP/1.1
Host: 169.254.169.254
Content-Type: application/json
{"accepted": true}
req.baseUrl as http://169.254.169.254, builds the fetch target http://169.254.169.254/uploads/ai-helper-images/<_id>.png, and issues the outbound request.Derivation confirmed against source logic:
base64 record (no url) + Host: 169.254.169.254
-> new URL("/uploads/ai-helper-images/<_id>.png", "http://169.254.169.254")
-> server fetches: http://169.254.169.254/uploads/ai-helper-images/<_id>.png
control (apos.baseUrl set to https://cms.example.com):
-> fetch target uses https://cms.example.com (Host ignored)
control (record stores its own url):
-> aiHelperImageUrl short-circuits to the stored url (no SSRF)
@apostrophecms/ai-helper-image module registers POST and PATCH routes under /api/v1/@apostrophecms/image/ai-helper, reachable by any authenticated session on a site that installed the package.Host header on the PATCH request; the global locale middleware copies it into req.baseUrl because apos.baseUrl is unset (packages/apostrophe/modules/@apostrophecms/i18n/index.js:805,816-819).POST, which inserts a record without a url (ai-helper-image/index.js:282-284); the returned identifier is then used in the PATCH accept request, which calls aiHelperFetchImage (:332).The generate route's checkPermissions guard (ai-helper-image/index.js:176) is not present on the accept route, so no authorization protects the fetch. The following refutations were tested and defeated:
uploadfs.getUrl() yields /uploads because the local backend builds uploadsUrl = (apos.baseUrl || '') + prefix + '/uploads', so new URL(relative, req.baseUrl) takes its origin from req.baseUrl. Configuring a base URL or an absolute storage URL (S3/CDN) defeats the attack, which is why those are negative controls, not the default.url: insertOne(image) stores the record before image.url is assigned on the in-memory response object (:282-284 versus :294), so the PATCH handler re-reads a record with no url and the short-circuit in aiHelperImageUrl does not apply.GET and DELETE on these records are userId-scoped and cuid2 identifiers are unguessable, so the practical actor is the generating editor; this bounds the required privilege to a low-privileged authenticated user rather than an anonymous or cross-tenant attacker.Ecosystem: npmPackage: @apostrophecms/ai-helperConfirmed affected range: >= 1.0.0-beta.10, <= 1.0.0-beta.12Latest release checked: 1.0.0-beta.12 (npm registry, dist-tag latest)Fix status: not fixedThe vulnerable pattern was introduced in 1.0.0-beta.10: earlier releases through 1.0.0-beta.9 fet
This page as .md · .json · in your agent: get_signal("CVE-2026-113671")
GitHub Advisory Database, CC-BY 4.0 · NVD data is provided by NIST and is public domain. Posts quoted belong to their authors.
PATCHreq.body.acceptedfindOne({ _id }):318,:322POSTcheckPermissions:176aiHelperImageUrl resolves the relative storage path against the Host-derived req.baseUrl and aiHelperFetchImage calls fetch on the result (:91-92,:64-65).GET to the attacker-chosen origin at a fixed path, granting internal host and port reachability and limited semi-blind response retrieval that the attacker's network position does not otherwise permit.@apostrophecms/file module and its stream proxy and never touches packages/ai-helper; the rich-text import SSRF advisory uses a different route with an explicit hostname allowlist. No advisory exists for @apostrophecms/ai-helper. This is a parallel unguarded sink, not an incomplete fix of either.