Skip to content
This repository was archived by the owner on Aug 31, 2026. It is now read-only.

File checksum disclosure via /api/resources endpoint bypassing Perm.Download check

Moderate
hacdias published GHSA-7whw-q6gh-xr59 Jul 25, 2026

Package

gomod github.com/filebrowser/filebrowser/v2 (Go)

Affected versions

<= 2.63.18

Patched versions

2.63.19

Description

Summary

Incomplete fix of CVE-2026-35606: the /api/resources checksum branch still reads the full file and returns its digest without a Perm.Download check, so a user provisioned with Perm.Download=false gets a file-content hash oracle. It does not defeat scope/path authorization; it bypasses only the Download permission, yielding a content-hash oracle rather than plaintext. Confirmed at HEAD b7dc392.

The defect

CVE-2026-35606 was that /api/resources returned file content while bypassing Perm.Download. The fix (PR #5891, v2.63.1) gated the content-returning paths (changed the hardcoded Content: true to Content: d.user.Perm.Download, and added a 202 guard to the raw-byte X-Encoding branch). The same handler has a third full-file-reading path, the ?checksum= branch, which reads the entire file to compute a digest and returns it; it was not given a Perm.Download check.

http/resource.go, resourceGetHandler, the checksum branch (around lines 69-79):

if checksum := r.URL.Query().Get("checksum"); checksum != "" {
    err := file.Checksum(checksum)   // reads the whole file into the hash (files/file.go:170-207)
    ...
    return renderJSON(w, r, file)    // returns the digest in the checksums map
}

resourceGetHandler (withUser) has no Perm.Download check at the top. The three sibling read paths do guard it: raw.go:85 (if !d.user.Perm.Download { return http.StatusAccepted, nil }), preview.go:39, and subtitle.go:18. The checksum branch does not.

Attacker model and impact

An authenticated low-privilege user provisioned with Perm.Download=false (a first-class supported permission, the exact configuration CVE-2026-35606 is written against). GET /api/resources/?checksum=sha256 (also md5/sha1/sha512) with X-Auth returns the file digest. This is a Download-gate bypass yielding a file-content hash oracle: confirm known or guessed content, detect changes over time, or brute-force low-entropy files offline. It is broader than CVE-2026-35606 in that it hashes any file type of any size, with no text-only restriction and no 10 MB detectType cap. It does not defeat the scope/path authorization (only same-scope files).

Proof of concept: as a user with Perm.Download=false, GET /api/resources/?checksum=sha256 with a valid X-Auth token; the sha256 digest is returned.

Verification

Source-verified at HEAD: the checksum branch calls file.Checksum with no Perm.Download check, while raw.go:85 guards the same permission. I did not run a live File Browser.

Suggested fix

Add if !d.user.Perm.Download { return http.StatusAccepted, nil } ahead of the checksum branch in resourceGetHandler, matching the raw/preview/subtitle siblings.

Tooling

I used AI assistance while investigating, but I read the checksum branch (confirming no Perm.Download check) and raw.go (confirming the sibling guards it) myself at HEAD, so the inconsistency is source-verified.

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
Low
User interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
None
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N

CVE ID

CVE-2026-72834

Weaknesses

Exposure of Sensitive Information to an Unauthorized Actor

The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information. Learn more on MITRE.

Incorrect Authorization

The product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check. Learn more on MITRE.

Credits