Executive brief
CoreWCF, a library used to build web services on .NET Core, contains a flaw where security tokens can be reused by an attacker. Although the software has a setting to prevent 'replay attacks,' a bug in the underlying code fails to actually block duplicate tokens. This could allow an unauthorized user to capture a legitimate login token and reuse it to gain access to the service.
Technical details
A vulnerability exists in CoreWCF's SAML token validation logic where the 'DetectReplayedTokens' setting is ineffective. The root cause is in the 'DefaultTokenReplayCache.TryAdd' implementation, which unconditionally returns true even if a token key is already present in the cache. This bypasses the replay check performed by the inner Microsoft.IdentityModel.Tokens.Saml handler. An attacker who captures a valid SAML token can successfully replay it against the service to gain unauthorized access. The fix replaces the MemoryCache backing with a ConcurrentDictionary and ensures 'TryAdd' correctly identifies and rejects existing keys. This issue is resolved in versions 1.8.1 and 1.9.1.
Affected products
- CoreWCF CoreWCF < 1.8.1, >= 1.9.0 < 1.9.1
Timeline
- 2026-07-08: disclosed
- 2026-07-08: advisory
References
- https://github.com/CoreWCF/CoreWCF/commit/3800c4e2bb4c6fde00ddacefdc2221ef33d55621
- https://github.com/CoreWCF/CoreWCF/commit/7b0b5231cf21b4b5c1fc3caac9981f8bee43823f
- https://github.com/CoreWCF/CoreWCF/commit/84f8cff5a786b5aaa73448cb379d366a7df98238
- https://github.com/CoreWCF/CoreWCF/releases/tag/v1.8.1
- https://github.com/CoreWCF/CoreWCF/releases/tag/v1.9.1
- https://github.com/CoreWCF/CoreWCF/security/advisories/GHSA-9jr3-rj99-8jq3