apimock: Path traversal in apimock-server's file-serving fallback - #3176
apimock: Path traversal in apimock-server's file-serving fallback#3176nabbisen wants to merge 2 commits into
Conversation
djc
left a comment
There was a problem hiding this comment.
Thanks for reporting!
The advisory contents read like a fair amount of LLM slop. Suggest you edit it down to something more concise with only information that is directly relevant to downstream consumers.
| id = "RUSTSEC-0000-0000" | ||
| package = "apimock-server" | ||
| date = "2026-08-26" | ||
| url = "https://github.com/apimokka/apimock-rs/security/advisories/GHSA-72g6-wgrg-vhm7" |
There was a problem hiding this comment.
Not much point in linking the GHSA in the url when it's already used in aliases -- please link to an issue/PR/commit instead.
| This is the same issue as the advisory for the `apimock` crate. It is | ||
| recorded separately because `apimock-server` is published independently, | ||
| so a dependent embedding the server directly is affected without | ||
| depending on `apimock` at all. | ||
|
|
There was a problem hiding this comment.
I don't see much point in having two advisories for the same thing? If apimock inherits the problem because it uses apimock-server under the covers, having just an advisory for apimock-server should be sufficient.
Review feedback on rustsec#3176. Trimmed to what a downstream consumer acts on: the flaw, that it is read-only, what affects reachability, and the fixed versions. apimock-server goes from 67 lines to 33. Removed a paragraph describing what apimock-server is, one justifying why two advisories were filed, one about operator-authored respond.file_path and Rhai middleware paths which are not the reported vulnerability, and the 4.x/5.x version-line history. url now points at the fixing commit on each line rather than repeating the GHSA already present in aliases. Version ranges are unchanged and remain correct.
|
@djc On the prose: you're right. I wrote these in the register we use for our own design documents, where explaining why is the point. That's the wrong register for an advisory, whose reader is triaging On the On having two advisories: I'd like to check one thing before acting, because I think the inheritance holds for one line and not the other.
For 5.x and later you're plainly right: I drafted a version that scoped the Rather than invent a convention in your database: how would you prefer this expressed? Options I can see are to keep both as they are and accept that 5.x matches twice, or to drop the |
|
I would say it is true that apimock 5.x is unaffected by the apimock advisory, because it is covered by the apimock-server API. I think that would be the best way to express things -- so still two advisories, and add a line that clarifies the situation for both. |
Affected crate(s)
apimock(62,580 downloads all-time; 947 recent per crates.io)apimock-server(653 downloads all-time; 408 recent per crates.io)Links to upstream issue(s) or PR(s)
Filed by the crate maintainers — reported, fixed and disclosed by us, so
there is no third-party upstream report to link.
Severity
Path traversal allowing unauthenticated remote file disclosure: a
request carrying a raw
..segment escaped the configured responsedirectory, and the file was returned with HTTP 200. Read-only — no
write, no code execution.
Exposure is conditional on deployment, which is why we rate it modestly:
127.0.0.1, where an attacker must already be ableto run a process on the machine.
..away beforesending, so a malicious web page cannot reach it.
0.0.0.0or a LAN address —most commonly a container, where binding loopback would make the port
unreachable from the host. Multi-user machines are also affected on the
loopback default.
CVSS v4.0:
AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N—AT:Precords the non-default-bind requirement.apimock is a development and testing mock server, not intended for
production or as a public listener; that context bounds the impact but
does not remove it, which is why it was fixed rather than documented.
Two crates, two version ranges
apimockspans both supported lines — 4.x ships as that single crate,5.x as a workspace — so it carries two ranges with separate fixes:
< 4.8.1(patched 4.8.1) and>= 5.0.0, < 5.19.1(patched 5.19.1).Both lines are supported; neither requires a major-version change.
apimock-serveronly exists post-split (first published 5.0.0), so itsrange is
>= 5.0.0, < 5.19.1, patched 5.19.1. It is filed separatelybecause it is published independently and carries the vulnerable serving
code — a dependent embedding it directly is affected without depending
on
apimock.Versions before 4.0.0 were not assessed and are therefore treated as
affected rather than claimed unaffected.
Checklist
RUSTSEC-0000-0000as the IDdatefield is set to the public disclosure date