Test jti reuse rejected after cache flood - #19599
Conversation
52a25bc to
b6d75dc
Compare
b6d75dc to
9920d69
Compare
|
@jgrandja thank you for re considering; I really appreciate it 🙏 . I have re-submitted title / description / content - hopefully it's a valuable addition to the |
|
Thank you @anthonydahanne and apologies for the confusion. I will get to this soon. Thanks. |
|
@anthonydahanne I took a look at the test and I'm not understanding exactly what the difference is compared to The test in this PR also demonstrates replay detection and it additionally floods the cache but I don't see the value of it? It floods the cache with 1200 entries - 600 entries per key bucket so within the per key limit of 1000. The default max entries allowed is 100,000 and also within the limit given 1200 entries plus 1 entry of the original proof. Can you provide some clarification on the main goal of the test? Maybe I'm missing something? |
|
Hello @jgrandja ! The distinction I was aiming for is that The former implementation had That said, you are right about the test as currently written: it injects the new I suggest to you that either:
|
|
@anthonydahanne Can you please rework the test and configure |
Configure a small maxSize and maxRequestsPerKey, then verify a proof is rejected once the cache is full and that a still-cached jti is rejected as a replay. Signed-off-by: Anthony Dahanne <anthony.dahanne@gmail.com>
9920d69 to
a9ca38a
Compare
|
@jgrandja I updated the test with smaller sizes and replay detection and rejections |
Test-only; no production code changes.
Adds a regression test to DPoPProofJwtDecoderFactoryTests for the replay cache under flooding.
The existing tests cover a plain single-proof replay, but not the case where the cache is filled past its size limit before the replay.
The new test floods with proofs signed by other keys; split across two so neither hits the per-key request limit.
Then confirms a fresh proof from the original key is still accepted while a replayed one is rejected, so only replay detection (not the per-key throttle) can account for the rejection.