coheigea opened a new pull request, #771: URL: https://github.com/apache/ws-wss4j/pull/771
A SAML assertion marked OneTimeUse may only be accepted once. WSS4J enforces this by remembering the assertion’s ID in a replay cache. For that to work, the ID has to stay in the cache for as long as the assertion is valid. It didn’t always, so the same assertion could be sent again and accepted. No race was needed; the copies could be sent one after another. The patch closes three gaps: 1. Long expiries were cut to the default, not the maximum. Each cache has a default lifetime and a maximum. When an assertion was valid for longer than the maximum, the cache used the default instead: 5 min instead of 1 h for the in-memory cache, and 1 h instead of 12 h for Ehcache. It now uses the maximum. 2. Assertions without an end time. If an assertion has no NotOnOrAfter, WSS4J accepts it until IssueInstant + 30 min, but cached its ID for the cache default (5 min for the in-memory cache). It’s now cached for the whole time it’s accepted. 3. Assertions valid for longer than the cache can hold. Even capped at the maximum, an assertion valid for, say, 24 h would drop out of a 12 h cache and could then be replayed. Caches now report their maximum through a new getMaxTTL() method, and the validators reject OneTimeUse assertions that outlive it. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
