Habr•September 11, 2026•🇷🇺Translated from Russian

API Token Lifecycle: From Issuance to Revocation and Secure Management

The security of API tokens extends far beyond cryptographic signatures. Even a properly signed token using a strong algorithm can be stolen and abused because the signature only prevents modification, not theft. Once an attacker obtains a valid access token, the server typically cannot distinguish the legitimate user from the attacker presenting the stolen credentials.

Stage 1: Token Issuance

Security begins at creation. Public clients such as single-page applications and mobile apps must use the Authorization Code Flow with PKCE rather than legacy implicit flows. PKCE binds the authorization request to a client-generated code_verifier, preventing an attacker who intercepts only the authorization code from completing the exchange. Confidential backend services should use the client_credentials grant with short-lived tokens and regularly rotated secrets stored in dedicated secret-management systems.

Access tokens for browser applications should expire within 5 to 15 minutes. Refresh tokens may live longer, supporting sliding sessions with an absolute maximum lifetime to force re-authentication. Endpoints such as /login, /token, and /oauth/authorize require strict rate limiting that considers account identifiers, device signals, and IP ranges, not just single addresses. Confidential clients can further strengthen authentication by presenting short-lived signed JWT assertions instead of static client secrets.

Stage 2: Client-Side Storage

Storing tokens in localStorage or sessionStorage exposes them to any JavaScript running on the page, including code injected through XSS, compromised npm packages, or supply-chain attacks. HttpOnly cookies marked Secure and SameSite=Lax significantly reduce direct token extraction. The Backend-for-Frontend (BFF) pattern offers even stronger protection by keeping OAuth tokens on the server; the browser receives only an opaque session identifier stored in an HttpOnly cookie. Session data can be maintained in Redis or another secure backend store, enabling centralized rotation, revocation, and monitoring.

Stage 3: Transmission and Usage

Bearer tokens are commonly sent in the Authorization header and require TLS. Cookie-based authentication simplifies client code but necessitates additional CSRF defenses such as synchronizer tokens or strict Origin/Referer validation. Sensitive operations should combine multiple layers rather than relying on any single browser flag.

By following short-lived tokens, atomic refresh-token rotation, HttpOnly cookies or BFF architecture, and comprehensive revocation capabilities, applications can substantially limit the impact of token compromise.

Related articles

Habr•Vulnerabilities & Exploits

Six Months After tun0 Leak: Which Android VPN Clients Fixed Server Address Exposure and Which Ignored It

A detailed investigation reveals that Android VPN clients suffer from two distinct server address leaks when split tunneling is enabled. The first leak, tied to an unprotected local SOCKS proxy on 127.0.0.1, was quickly mitigated by most Xray and sing-box based clients through random ports and passwords. The second, more persistent leak allows excluded applications to bind sockets directly to the tun0 interface and discover the VPN server IP without root or special permissions. Only TeapodStream and OlConnect implemented owner-UID checks using ConnectivityManager.getConnectionOwnerUid, yet both initially mishandled the INVALID_UID response returned for excluded apps. AmneziaVPN has unmerged pull requests that correctly reject unknown owners, while sing-box offers a manual package_name_regex rule. v2rayNG closed the report as not planned, and major clients including WireGuard for Android, Mullvad, Proton VPN and others have issued no statements.

Habr•Vulnerabilities & Exploits

Part 2: How Third-Party Developers Closed the tun0 Leak in AmneziaVPN on Android

Third-party contributors to AmneziaVPN have detailed their fix for a VPN tunnel bypass affecting excluded applications on Android. The vulnerability allows any app, even those disallowed from the VPN, to bind sockets directly to the tun0 interface using SO_BINDTODEVICE and thereby discover the VPN server address. The team implemented a packet filter inside the client that queries Android via ConnectivityManager.getConnectionOwnerUid to determine packet ownership and drops traffic from unknown UIDs. The solution was integrated into both the Xray and AmneziaWG traffic paths, with the AmneziaWG hook placed inside amneziawg-go after packet parsing. Testing with leak_probe.py showed zero successful bypass attempts out of six methods when the filter was active, compared to six out of six without it. The developers submitted three pull requests and released a side-loaded test build, while noting remaining limitations such as raw sockets and tethering scenarios.

BoletimSec•Vulnerabilities & Exploits

Cisco Confirms Active Exploitation of CVE-2026-76504 in Catalyst SD-WAN Manager

Cisco has confirmed that the critical vulnerability CVE-2026-76504 in Catalyst SD-WAN Manager has been exploited in attacks throughout September. The flaw carries a CVSS score of 9.8 and allows attackers to gain full administrator access without any credentials by bypassing API authentication through malformed URI encoding. The issue affects the login session handling mechanism, enabling forged requests to grant netadmin privileges by default. Similar URI manipulation techniques were observed earlier this month in Oracle PeopleSoft attacks. Patches are available across multiple release trains including 20.9.10.1, 20.12.8.2, 20.15.6.1, 20.18.4.1, 26.1.2.1 and 26.2.1, while older installations must migrate to supported versions. Cisco recommends restricting access to trusted hosts and placing the Manager behind firewalls until updates are applied. The vulnerability was discovered during routine support operations and verified by Cisco's Product Security Incident Response Team.

BoletimSec•Vulnerabilities & Exploits

Zero-Days in PaperCut MF Chained to Compromise Active Directory in Education Sector

Analysts at eSentire investigated an attack that chained two zero-days in PaperCut MF, tracked as CVE-2026-81578 and CVE-2026-82078, to move from an internet-exposed print server to a domain controller in an education sector client in under two days. Attackers gained initial access through the card or badge query field, delivering malicious Java code that allowed unauthenticated configuration changes and arbitrary bytecode execution on version 24.0.2. The first stage loader reassembled payload fragments in memory, launched the next stage, and deleted its own files while remaining compatible with multiple Tomcat versions. A web shell followed, accepting commands via a custom HTTP header, reading configurations, and erasing log traces while positioning itself early in the request processing chain. The command-and-control implant was AdaptixC2, hidden inside a modified Microsoft Copilot binary downloaded from Alibaba Cloud infrastructure. Privilege escalation was achieved without passwords by locating a domain-privileged service account, stealing its access token, and relaunching the implant under those rights. On the domain controller the payload arrived via administrative share and was executed by modifying the Windows PlugPlay service, after which the legitimate path was restored to minimize traces. The operators extracted credentials from memory and registry, enabled Restricted Admin mode, used an NTLM hash for RDP access, and copied the full Active Directory database containing passwords for all domain accounts.