# Hardcoded address or key backdoor

Literal address, key, magic constant, or hard-coded true that bypasses normal authorization

_Area: Smart contract access control and control flow. Seen in 2 disclosed reports; latest 2026-10-30. Updated 2026-11-17._

## How it works
A privileged action is supposed to pass through an authorization check, but a literal value short-circuits it. The check is replaced by a constant: a specific caller address, a magic amount, or a hard-coded `true`/`Ok(())` where a callback or confirmation should run. The assumption that breaks is "every privileged path consults the same policy." One branch does not, and nothing in the normal auth surface reveals it. The backdoor is reachable by whoever matches the literal, and the literal is often visible in verified source or shipped binaries [E2](https://bugbountylibrary.com/r/ghsa%3AGHSA-vp5q-ff62-jwqv.md)[E3](https://bugbountylibrary.com/r/dhl%3A20250327-yziaitoken.md).

## Where it shows up
- `transfer`/`transferFrom`/`approve` overrides containing a literal `msg.sender` comparison plus a magic number that gates mint, approve, or swap [E3](https://bugbountylibrary.com/r/dhl%3A20250327-yziaitoken.md)
- Authorization branches awaiting `future::ready((x, true))`, `Ok(())`, or a constant instead of calling the real check/confirm callback [E2](https://bugbountylibrary.com/r/ghsa%3AGHSA-vp5q-ff62-jwqv.md)
- Admin or migration operations that export or package private key material, gated only by group membership [E1](https://bugbountylibrary.com/r/blog%3Ahuntress-com-blog-ad-rms-slc-encryption-key.md)
- Constraint flags accepted at add-time but never enforced at sign-time [E2](https://bugbountylibrary.com/r/ghsa%3AGHSA-vp5q-ff62-jwqv.md)
- Refactor residue: async-trait conversions that stubbed a callback and never restored it [E2](https://bugbountylibrary.com/r/ghsa%3AGHSA-vp5q-ff62-jwqv.md)

## How to review
For every privileged action, trace the exact branch that authorizes it and confirm it calls the same policy function as its siblings. The invariant: no authorization decision may be a compile-time constant, and no caller identity may be compared to a literal embedded in code. On-chain, read every override of transfer-family functions line by line and flag any literal address or magic amount. Off-chain, grep authorization paths for `true`, `Ok(())`, `ready`, and hard-coded keys. For key-export features, ask whether the export is gated by more than group membership and whether it is logged [E1](https://bugbountylibrary.com/r/blog%3Ahuntress-com-blog-ad-rms-slc-encryption-key.md).

## How finders spotted it
- Read the agent server's `try_sign` path and noticed the confirm branch awaited a constant future instead of `agent.confirm(...)`; then bisected crates.io releases to pin the regression to 0.50.0-beta.12 and confirmed with a unit test [E2](https://bugbountylibrary.com/r/ghsa%3AGHSA-vp5q-ff62-jwqv.md)
- Threat-modeled the trust chain, identified the unrotatable root key analogous to KRBTGT/DPAPI backup key, then inspected the admin SOAP surface and found the export operation returned the private key to any Service Group member [E1](https://bugbountylibrary.com/r/blog%3Ahuntress-com-blog-ad-rms-slc-encryption-key.md)

## Variants seen
- On-chain magic-constant branch in `transferFrom` that mints and swaps to a manager address [E3](https://bugbountylibrary.com/r/dhl%3A20250327-yziaitoken.md)
- Hard-coded success in an agent confirmation callback, silently disabling a user-facing constraint [E2](https://bugbountylibrary.com/r/ghsa%3AGHSA-vp5q-ff62-jwqv.md)
- Legitimate admin/migration feature that hands out the root private key to a broad group with no logging [E1](https://bugbountylibrary.com/r/blog%3Ahuntress-com-blog-ad-rms-slc-encryption-key.md)

## Impact and severity
Highest tier. The on-chain backdoor let the manager mint and drain LP at will [E3](https://bugbountylibrary.com/r/dhl%3A20250327-yziaitoken.md). The agent flaw let keys added with `ssh-add -c` sign without approval, and agent forwarding extended reach to remote hosts; downstream Proton Pass used confirm as its vault-unlocked gate, so signing proceeded while locked [E2](https://bugbountylibrary.com/r/ghsa%3AGHSA-vp5q-ff62-jwqv.md). The key export gave silent offline decryption of all protected content plus forged RACs impersonating any identity, including group members via GroupExpansion [E1](https://bugbountylibrary.com/r/blog%3Ahuntress-com-blog-ad-rms-slc-encryption-key.md). Impact rose with reach (forwarding, group expansion) and with the key being unrotatable [E1](https://bugbountylibrary.com/r/blog%3Ahuntress-com-blog-ad-rms-slc-encryption-key.md).

## 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.
- **russh (rust)** < 0.65, fixed in 0.65: russh: Agent server never calls `Agent::confirm`, so keys added with the confirm constraint (`ssh-add -c`) sign without  (CVE-2026-116794). Report: https://bugbountylibrary.com/r/ghsa%3AGHSA-vp5q-ff62-jwqv.md. Fix: https://github.com/Eugeny/russh/commit/3e04597dc54e36bfc85c21996f7d8d9d224e9826

## Evidence
- E1: https://bugbountylibrary.com/r/blog%3Ahuntress-com-blog-ad-rms-slc-encryption-key.md
- E2: https://bugbountylibrary.com/r/ghsa%3AGHSA-vp5q-ff62-jwqv.md
- E3: https://bugbountylibrary.com/r/dhl%3A20250327-yziaitoken.md
