apimock: Path traversal in apimock-server's file-serving fallback - #3176
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.
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. |
Per review: apimock 5.x is unaffected by the apimock advisory because apimock-server's advisory covers it. Each advisory now carries a line explaining the split — apimock 4.x is a single crate with the serving code inside it; from 5.0.0 that code lives in apimock-server, which apimock depends on. Coverage is unchanged: apimock 5.x depends on apimock-server, so any lockfile containing apimock 5.x also contains apimock-server and is flagged by that advisory whenever it resolves below 5.19.1.
|
@djc, done — thanks, that's a much cleaner way to express it.
patched = [">= 4.8.1, < 5.0.0"]
unaffected = [">= 5.0.0"]And each advisory has a line pointing at the other:
I checked that 5.x users still get flagged: |
Review feedback on #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.
|
LGTM, thanks! |
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