HackproofHacks

Vulnerability

Apache WSS4J Security Flaw Allows Hackers to Reuse Captured Tokens

oss-security (seclists) covered this vulnerability on Sep 30, 2026. Below is a plain-English breakdown of what it is, how it actually works, and whether it matters, written for people who are curious about hacking and security but don't have a technical background.

oss-security (seclists) · Sep 30, 2026

In plain words

Imagine you have a safe where you store important documents, but the lock on the safe can be tricked into opening with a copied key if the copy is made in a certain way. In plain words, this is what's happening with Apache WSS4J, a security tool that helps protect online services from unauthorized access. The tool is supposed to prevent someone from reusing a captured security token, but due to a flaw, this protection can be bypassed.

What's broken

The specific bug is in how Apache WSS4J stores and checks something called a Nonce¹, which is part of a UsernameToken² used for authentication. The Nonce is stored as raw base64³ text, but when it's used for authentication, it gets decoded into bytes⁴. The problem is that the same bytes can be represented in base64 in multiple ways, allowing an attacker to re-encode a captured Nonce in a way that Apache WSS4J will accept as new, even though it's actually a replay of a previously used token. This affects Apache WSS4J versions 4.0.0 before 4.0.2, 3.0.0 before 3.0.6, and versions before 2.4.4.

How it actually works

Here's how it actually works: when a user tries to access a protected service, they send a UsernameToken that includes a Nonce, which is like a one-time password. Apache WSS4J is supposed to check if this Nonce has been used before by storing all the Nonces it has seen. However, because of the flaw in how Nonces are stored and checked, an attacker can capture a UsernameToken, re-encode its Nonce in a different but equivalent base64 format, and then reuse the token to gain unauthorized access. This works because the authentication process decodes the base64 text into bytes, which can be represented in multiple base64 formats, thus bypassing the replay protection.

Proof of concept

There is a public description of this vulnerability, which means that the flaw has been demonstrated to be real and exploitable. A proof-of-concept (PoC)⁵ shows that the vulnerability can be used to bypass the replay protection, making it a significant issue. The existence of a PoC sharply raises the urgency because it proves the flaw is not just theoretical but can be practically exploited.

Is it real

It's not clear from the source if this vulnerability is being actively exploited in the wild. However, given its moderate severity and the fact that a fix is available, users should update their Apache WSS4J to a version that includes the patch, such as 4.0.2 or later for the 4.0 branch, 3.0.6 or later for the 3.0 branch, and 2.4.4 or later for earlier versions.

What to do

To fix this issue, users should update Apache WSS4J to the latest version that includes the security patch. This involves downloading and installing a newer version of the software that fixes the Nonce storage and checking mechanism, thus preventing the replay attack. By updating, users ensure that their services are protected against this specific vulnerability.

Terms

¹ Nonce
, A random value used once to prevent replay attacks
² UsernameToken
, A token used for authentication that includes a username and other security information
³ base64
, A way of encoding binary data using only characters that are safe to send over the internet
⁴ bytes
, The basic units of information in computing
⁵ proof-of-concept
, A demonstration that a vulnerability can be exploited, proving it is real and not just theoretical

Learn the fundamentals

Want to understand the concepts behind this item? These in-depth HackproofHacks guides explain the underlying techniques from the ground up.

About this explainer

KeepLooped tracks the newest offensive-security tools, techniques, vulnerabilities and research from 80+ trusted sources and turns the most important items into plain-language explainers, so people learning security can keep up without a technical background. This page summarises and explains the source linked below; it was produced with AI assistance and is meant as a beginner-friendly starting point. Always confirm specifics, versions, CVE details, and exploitation status, against the original source and official advisories. Curated and published by HackproofHacks.