Skip to content

Archive

Security Tokens

5 articles
Cybersecurity 10 Sep 2026 10 min read

Consume One-Time Security Tokens Atomically

A password-reset link may be described as “single use”, yet two requests arriving almost together can both see the token as unused. If each request then continues independently, the application can perform a security-sensitive action twice even though its data model contains a used flag. This is a concurrency problem with security consequences. The same pattern can affect account invitations, email-verification links, recovery codes, approval links, and other credentials that are supposed to grant authority once.

Cybersecurity 07 Sep 2026 9 min read

Compare Secret Values Without Timing Leaks

Applications compare security-sensitive values constantly: message authentication codes, webhook signatures, API tokens, recovery codes, and other secret authenticators. A normal string or byte comparison may stop as soon as it finds a mismatch. That is efficient, but when the compared value is secret, the amount of work can depend on how much of the candidate matched. If an attacker can obtain useful timing measurements over many attempts, data-dependent comparison time can become an information leak. The practical defense is not to write a clever comparison loop. Use a well-reviewed constant-time comparison primitive provided by the language, cryptographic library, or platform for secret values of the expected form.

Cybersecurity 06 Sep 2026 10 min read

Consume One-Time Tokens Atomically

A password-reset link may be labelled “single use” while still being usable twice. The problem is often not token randomness or expiration. It is a race between two requests that both verify the token before either request marks it as used. That matters because temporary tokens frequently authorize sensitive actions: resetting a password, verifying an email address, accepting an invitation, or completing account recovery. If the application promises one-time use, concurrent requests should not be able to turn that promise into two successful authorizations.

Cybersecurity 04 Sep 2026 11 min read

Bind Security Tokens to Their Intended Purpose

Applications often use temporary tokens to authorize narrow actions: verify an email address, reset a password, accept an invitation, approve an account change, or continue an authentication flow. A token can be random, unexpired, and correctly signed yet still be dangerous if the application accepts it for a different action than the one for which it was issued. The practical problem is token confusion. One part of a system proves that a token is authentic, while another part assumes that authenticity means the token is valid for whatever operation is currently being requested. If different flows share token formats, validation code, or signing keys, that assumption can turn a limited credential into broader authority.

Cybersecurity 03 Sep 2026 9 min read

Generate Security Tokens with Cryptographic Randomness

Many security features depend on a value that an attacker must not be able to guess. Password-reset links, email-verification links, invitation codes, session identifiers, and one-time capability URLs are common examples. If such a token is predictable, an attacker may not need to steal it. They may be able to guess a valid value instead. The defensive requirement is therefore stronger than “make the token look random.” A security token needs enough entropy, meaning uncertainty from the attacker’s point of view, and it needs to come from a generator designed for security-sensitive randomness.