How many green tests does it take to believe a protection works? We have about two thousand, and they pass on three databases. A person still found the hole: an outside researcher who worked through our server and saw a connection where we had seen none.
This is the story of GHSA-vmj2-8phj-mfxf in redb.Identity, our OAuth 2.1 / OpenID Connect server for .NET. In order and with dates: what was broken, why we did not see it ourselves, how we fixed it and how we disclosed it.
The report
On 4 November a private report on version 4.6.1 came in. Its author, Rathnadeepan (HotWater, HotWater-015 on GitHub), did not open a public issue or write a blog post about it. He wrote to us directly and left us time to fix it.
We checked the report against the source the same day. It was all true.
DPoP in two paragraphs
A plain access token is accepted from anyone who presents it. If it is stolen from a log, a proxy or an intermediate node, it can be used. DPoP (RFC 9449) changes that by binding the token to the client's key. The token carries the key's thumbprint (cnf.jkt), and with every request the client sends a short proof signed by that key: method, URL, time, a one-time identifier and the hash of the token itself. Without the private key there is no proof, so a stolen token is useless.
We wrote about this in detail in Your access token was stolen. Now what. That made it all the more unpleasant to learn that at two endpoints of our own server this protection did not work.
What was broken
With DPoP enabled (Dpop.Enabled = true, off by default), the server issues tokens bound to a key. The proof of possession was checked only when the token was issued, at /connect/token. Two endpoints of the server itself, /connect/userinfo and the management API /api/v1/identity/... (SCIM included), read only the Bearer scheme and never looked at the DPoP header.
So a bound token was accepted there as a plain Bearer token: with no proof and without the key it is bound to. Someone who had obtained such a token, but not the client's private key, could read the user's claims at userinfo and use the management API within the token's scope.
Affected: redb.Identity.Core versions 1.0.1 through 4.6.1 (fixed in 4.6.2), and only deployments with DPoP enabled. Resource servers that validate tokens with redb.Identity.Resource.Dpop were not affected: the proof was always checked there. CVSS 3.1 score 7.4, High, class CWE-287 (improper authentication).
Why we did not see it
Ever since DPoP arrived in the 1.x line, userinfo and the management API read only the Bearer scheme. Nobody looked at the cnf field at these endpoints, and a bound token went through like any other.
In October we moved to OpenIddict 7. Unlike version 6, it checks cnf on every token, but it only understands certificate binding (x5t#S256). On a token bound to a DPoP key it threw an exception, and in the 4.4.0 prereleases userinfo and the management API answered 500. That was the only period when a bound token did not get through at these endpoints, and the cause was an exception, not a check. We fixed the error: in front of the OpenIddict check we put a handler that turns it off for tokens with jkt. The change description says it plainly: the DPoP proof is checked by Identity itself.
That assumption was wrong: at these two endpoints nobody checked the proof, and from the 4.4.0 release on a bound token was accepted as Bearer again.
Along with that fix came a test, "userinfo accepts a DPoP-bound token". It obtained a token, called userinfo with the Bearer scheme and a DPoP header, and expected 200. The answer was 200, the test was green. But the server never read that header, and without it the answer would have been the same. The test checked that a good request goes through, and in doing so it locked in the very defect that a person from outside found later.
The conclusion we drew: for a protection mechanism, a "must accept" test without a "must refuse" test proves almost nothing.
The first day and night
We confirmed the defect by reading the source the same day. We also checked how far back it went: the new tests were run on a commit that still used OpenIddict 6.3, and the token was accepted there too. Hence the range in the advisory, from 1.0.1.
Then, in order:
- 23:06, 4 November. A failing test first: 18 cases on userinfo and the management API. A bound token as Bearer without a proof, as Bearer with a proof, a proof from another key, a replayed proof, a proof for another URL or method, an expired one, one without
ath; an unbound token under the DPoP scheme; and next to them a check that a plain unbound Bearer token is still accepted. - 23:33. The fix; the new tests green.
- The night of 5 November. Full runs on PostgreSQL, SQL Server and SQLite: 2007 tests on each database, none failed. Then the upgrade notes.
- 5 November. Release 4.6.2.
Now a bound token is accepted at these endpoints only under the DPoP scheme with a valid proof: signed by the bound key, matching method and URL, ath equal to the token hash, a fresh time, an unused jti. Otherwise the answer is 401 with the challenge WWW-Authenticate: DPoP error="invalid_token". Plain unbound Bearer tokens and certificate-bound tokens work as before.
Our management API is also available over gRPC and SOAP. There is nowhere to carry a DPoP proof there, so a bound token is now refused on these channels: gRPC answers Unauthenticated, SOAP returns a fault. They need a plain Bearer token, or the HTTP API.
Disclosure
The advisory stayed private until the reporter agreed to publication. We asked GitHub for a CVE number twice, on 5 and 11 November, and no number came. We did not wait longer: with the reporter's consent the advisory was published on 15 November under its GHSA identifier. If a CVE is assigned later, we will add it.
Why the number is taking so long, we were not told. Our guess: vulnerabilities are being searched for very actively right now, breaches of large companies are reported all the time, and findings in small and open source projects are more numerous still. There seem to be so many CVE requests that GitHub cannot keep up. For a small project the conclusion is simple: publish the advisory yourself once the fix is out and the reporter agrees, and add the number when it arrives.
By the time everyone learned about the hole, the fix had been on NuGet for ten days. That was possible because the reporter sent the finding to us, not to a public tracker, and gave us time to close it.
Our side is to answer fast, fix fast, credit the reporter by name and publish the advisory even without a CVE number.
Holes like this are found by people
Tests, release checks and our own review check what we imagined ourselves. If the developer's picture is "the proof is checked somewhere else", the test gets written for that picture and passes. Two thousand green tests say nothing about what is missing from the picture.
This vulnerability did not sit in one line. It was assembled from several things that each looked harmless and had no obvious link to one another:
- endpoints that had read only the Bearer scheme since the first versions;
- a library check we switched off to get rid of a 500 error;
- the description of that change, saying the proof is checked elsewhere;
- a test that confirmed a good request goes through.
Someone had looked at each of these, and each one on its own was fine. They live in different places in the code and appeared in different months. To see the hole you have to hold all of them in your head at once and ask where the key is actually checked. Automated checks do not ask that question; they look at each part separately. Vulnerabilities like this are found by a person who studies the system and reasons about it.
So a report from an outsider is, for us, a review he did on our behalf. Reports like this are very valuable to us, and I think to other projects too. Rathnadeepan, thank you.
What do you think?
What we changed
- Refusal tests for every protected endpoint. A separate test for each form of bad request, checking that the server refuses it.
- Demos on every built image. Our own DPoP demo still called userinfo the old way after 4.6.2, with the Bearer scheme, and expected 200. We only noticed on 14 November, when we first ran the whole demo set against a full image built from the main branch: that step answered 401, as it should after the fix. The demo now follows RFC 9449, section 7.1: userinfo with the DPoP scheme, and the Bearer form must be refused. The demo set now runs on every full image build and in the checks before a release.
- An advisory even without a CVE. Users learn about a hole from our changelog and advisory, and do not wait for a number.
If you use redb.Identity with DPoP
Update redb.Identity.Core to 4.6.2 or later: the fix lives there. Update redb.Identity.Http along with it, so that userinfo answers the client with the DPoP challenge; with an older redb.Identity.Http a token without a proof still gets 401, only the challenge comes in the Bearer form. Clients that obtain bound tokens and call userinfo or the management API need to send the DPoP scheme and a proof with ath; details in UPGRADING.md.
If you cannot update right away, there is no setting that restores the check. Shorten the access token lifetime and revoke tokens that may have leaked. If DPoP is off in your deployment, the defect does not affect you.
Over to you
How does this work in your projects? Is there a clear channel for security reports, and what happens when a report arrives: who reads it, how long does it wait for an answer? Have you waited weeks for a CVE number, and how did it end? And if you have found holes in someone else's code, how were you received? Tell us in the comments.
If this was useful, a ⭐ on GitHub helps others find it.
More of my writing: redbase.app/articles, and on dev.to.



