Skip to content

4.8.1

Choose a tag to compare

@nabbisen nabbisen released this 26 Aug 12:00
· 212 commits to main since this release
911ebac

Security release. Fixes a path-traversal issue in the file-serving
path. See GHSA-72g6-wgrg-vhm7
for the advisory, including affected versions and workarounds.

Security

  • Resolved file paths are now confined to the directory they were
    resolved against.
    The file-serving fallback built a path from the
    request URL and joined it onto the configured response directory,
    checking only that the result existed — never that it stayed inside
    that directory. A request carrying an un-normalised .. segment could
    therefore read files outside it.

    The same missing check applied to a rule's respond.file_path and to
    a path returned by a Rhai middleware script. Both are
    operator-authored rather than request-derived, so neither was
    reachable by a client, but both could reference locations outside the
    response directory.

    Every resolved path is now canonicalised and checked against the
    canonicalised base directory for its site, enforced at a single point
    so every caller inherits it. Anything outside is refused with a bare
    404, indistinguishable from an ordinary not-found. As a second,
    independent control, .. segments are stripped from the request path
    before file resolution.

    Affected: 4.0.0 through 5.19.0. Also fixed in 5.19.1. v4 remains
    supported — there is no requirement to change major version.