The class requires three things: a security-relevant token (password reset, session, invite, API key, confirmation code), a deterministic derivation routine that includes a cryptographic hash, and an input to that derivation drawn from a space the attacker can observe or enumerate.
The input is often not literally secret-looking, and the derivation was chosen because the developer was reasoning about pre-image resistance. Allegra's calculateTokenExpDate returned System.currentTimeMillis() + 28_800_000 and the next line was sha256(String.valueOf(expDate)). The handler's own response carried a Date: header that named the second the token was minted, inside a one-thousand-millisecond window the attacker enumerated at one HTTP GET per candidate. The function's name is the audit trail: it computes when the token expires, and the line that called it computed the token from the return value. Hashing a return value does not change what the return value was; calculateTokenExpDate returned an expiration date, and the token was the hash of an expiration date.
OpenMage's API session handler composed md5(time() . uniqid('', true) . $sessionName). The three inputs collapse to one: time() is the wall clock to the second, uniqid() is an LCG seeded from the wall clock whose PHP manual page warns it "does not generate cryptographically secure values," and $sessionName is a handler constant. The attacker read the clock from the response Date: header, narrowed the microsecond and LCG window from a handful of self-minted tokens, and brute-forced the remainder against an unrate-limited XML-RPC endpoint. A 2012 upstream change added uniqid to this same construction in response to "a randomness concern," replacing one time-derived input with a time-derived function. The schema column sized at forty characters (MD5 hex digest) had to be widened to sixty-four (SHA-256) in the fix; the storage layer's testimony that the field's design only ever expected a hash output.
FiberHome's HG6145F1 default PSK is the degenerate case. The derivation is not a hash at all, it is 'wlan' + ~SSID_suffix, a constant-prefix concatenation with the bitwise complement of twenty-four bits the device is required to broadcast. The exhibit isolates the cognitive error from the hash function itself. SHA-256 is not where the mistake lives. The mistake lives in reading the appearance of transformation as the production of entropy. A deterministic function with an attacker-observable input has no more output entropy than the input bits the attacker can see; the choice of function is an accounting detail for how long the enumeration takes. FiberHome's per-device PSK keyspace is one.
The cognitive error is predictable. The developer who chose the hash was reasoning about the difficulty of inverting SHA-256, which is genuinely high. Inverting the hash is not what an attacker needs to do here. The attacker enumerates a small set of plausible inputs and hashes each one forward. Hash functions are designed to make exactly that operation cheap. A laptop runs tens of millions of SHA-256s per second. Twenty-five bits of input is thirty-three million candidates and resolves in a second with no network involved; collapsed to ten bits by one Date: header, it resolves in a thousand GETs.
The failure repeats across implementations because the construction is a one-line shortcut for "make this field look like a random-looking string." Every language's standard library ships a cheap hash primitive; many do not ship a cheap CSPRNG primitive at the same reach. The developer who typed sha256(something) had the primitive already loaded; typing SecureRandom.nextBytes or secrets.token_bytes is a different reflex. The patch for every instance of this class is the same shape: stop deriving the token from a public value, generate it from a CSPRNG, and let the hash out of the construction. Allegra's 8.1.4 and OpenMage's fix both arrive there. The function whose name describes the expiration date keeps its name; the line that called it to derive the token is the line that gets deleted.