# Upload auth bypass via signature gate mismatch

Upload handlers where the signature gate checks a different credential source or auth type than the authorization check

_Area: Web access control and IDOR. Seen in 2 disclosed reports; latest 2026-04-14. Updated 2026-11-21._

## How it works
An upload handler must answer two questions: is this caller allowed to write (authorization), and did they prove possession of the secret key (signature verification). The bug is that these two checks read credentials from different places. The authorization layer accepts a credential from source A or source B; the signature gate only looks at source A, or only at whether a header is present. A caller who supplies credentials via source B passes authorization, and the signature gate either never runs or runs on an empty input and returns success. The same failure appears when a new auth type is added to some handlers but not others: the handler that never learned about the new type falls through to a path that skips verification [E1](https://bugbountylibrary.com/r/ghsa%3AGHSA-9c4q-hq6p-c237.md)[E3](https://bugbountylibrary.com/r/ghsa%3AGHSA-hv4r-mvr4-25vw.md).

## Where it shows up
- Signature gates keyed on header presence (`if Authorization != ""`) rather than on the credential the authz layer actually trusted [E3](https://bugbountylibrary.com/r/ghsa%3AGHSA-hv4r-mvr4-25vw.md).
- Credential extraction duplicated in two places: one honors `X-Amz-Credential` query param, the other only the header [E3](https://bugbountylibrary.com/r/ghsa%3AGHSA-hv4r-mvr4-25vw.md).
- A `switch` on auth type where a newly added case appears in some handlers but is missing from others (e.g. extract/snowball handlers) [E1](https://bugbountylibrary.com/r/ghsa%3AGHSA-9c4q-hq6p-c237.md).
- Guards that AND a persistent check (`.env` exists) with a volatile one (cache populated), where the cache-populating code has a silent `catch` [E2](https://bugbountylibrary.com/r/ghsa%3AGHSA-8rh5-4mvx-xj7j.md).
- Install/setup routes reachable after installation completes [E2](https://bugbountylibrary.com/r/ghsa%3AGHSA-8rh5-4mvx-xj7j.md).

## How to review
Find every place a request's credentials are read, and confirm all of them agree. The invariant: the exact credential source the authorization check trusts must be the same source the signature check verifies, and every handler that switches on auth type must handle every type. For each upload/install handler, list the auth types it accepts and check each one reaches a signature verification. For guards, ask what happens when the volatile half fails: a swallowed exception must fail closed, not open [E2](https://bugbountylibrary.com/r/ghsa%3AGHSA-8rh5-4mvx-xj7j.md).

## How finders spotted it
- Compared the auth-type `switch` statements across handlers after a new unsigned-trailer type landed; noticed the case was in PutObject/PutObjectPart but absent from PutObjectExtract [E1](https://bugbountylibrary.com/r/ghsa%3AGHSA-9c4q-hq6p-c237.md).
- Noticed the signature gate used header presence rather than the credential source `isPutActionAllowed` trusts [E1](https://bugbountylibrary.com/r/ghsa%3AGHSA-9c4q-hq6p-c237.md).
- Compared the two credential-extraction paths side by side: the streaming reader's gate checks only the header, while `isPutActionAllowed` also honors `X-Amz-Credential` in the query string [E3](https://bugbountylibrary.com/r/ghsa%3AGHSA-hv4r-mvr4-25vw.md).
- Read `InstallFilter::before()`'s dual-condition guard, then traced the `Filters` constructor's catch block that swallows DB exceptions and leaves cache empty [E2](https://bugbountylibrary.com/r/ghsa%3AGHSA-8rh5-4mvx-xj7j.md).

## Variants seen
- New auth type missing from one handler's switch, so that handler skips verification [E1](https://bugbountylibrary.com/r/ghsa%3AGHSA-9c4q-hq6p-c237.md).
- Header-vs-query-string asymmetry between the signature gate and the authz check [E3](https://bugbountylibrary.com/r/ghsa%3AGHSA-hv4r-mvr4-25vw.md).
- Fail-open guard: cache miss during DB outage lets unauthenticated re-entry to install, overwriting `.env` [E2](https://bugbountylibrary.com/r/ghsa%3AGHSA-8rh5-4mvx-xj7j.md).

## Impact and severity
Anyone holding a valid access key but not the secret key could write arbitrary objects, defeating the point of signing [E1](https://bugbountylibrary.com/r/ghsa%3AGHSA-9c4q-hq6p-c237.md)[E3](https://bugbountylibrary.com/r/ghsa%3AGHSA-hv4r-mvr4-25vw.md). In the install case, unauthenticated attackers overwrote `.env` with their own DB credentials, receiving all subsequent logins and form data, enabling content injection, phishing and privilege escalation — full takeover [E2](https://bugbountylibrary.com/r/ghsa%3AGHSA-8rh5-4mvx-xj7j.md). Severity rises with reach: storage write means data integrity across tenants; install re-entry means credential capture at scale.

## Seen in real software
Open-source packages and projects, and products, where this pattern was found. If the target runs one, compare the version it runs with the fix.
- **github.com/minio/minio (go)** >= 0.0.0-20230506025312-76913a9fd5c6, <= 0.0.0-20260212201848-7aac2a2c5b7c, no fix yet: MinIO has an Unauthenticated Object Write via Query-String Credential Signature Bypass in Unsigned-Trailer Uploads (CVE-2026-41145). Report: https://bugbountylibrary.com/r/ghsa%3AGHSA-hv4r-mvr4-25vw.md. Fix: https://github.com/minio/minio/commit/76913a9fd5c6e5c2dbd4e8c7faf56ed9e9e24091
- **github.com/minio/minio (go)** >= 0.0.0-20230506025312-76913a9fd5c6, <= 0.0.0-20260212201848-7aac2a2c5b7c, no fix yet: MinIO has an Unauthenticated Object Write via Missing Signature Verification in Unsigned-Trailer Uploads (CVE-2026-40344). Report: https://bugbountylibrary.com/r/ghsa%3AGHSA-9c4q-hq6p-c237.md. Fix: https://github.com/minio/minio/commit/76913a9fd5c6e5c2dbd4e8c7faf56ed9e9e24091

## Evidence
- E1: https://bugbountylibrary.com/r/ghsa%3AGHSA-9c4q-hq6p-c237.md
- E2: https://bugbountylibrary.com/r/ghsa%3AGHSA-8rh5-4mvx-xj7j.md
- E3: https://bugbountylibrary.com/r/ghsa%3AGHSA-hv4r-mvr4-25vw.md
