Skip to content

External DDoS Support for Retry Token Key Configuration #5005

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
kmmago opened this issue Apr 15, 2025 · 3 comments
Open

External DDoS Support for Retry Token Key Configuration #5005

kmmago opened this issue Apr 15, 2025 · 3 comments
Assignees
Labels
Area: API Area: Core Related to the shared, core protocol logic Area: Security Related to security or quality testing feature request A request for new functionality
Milestone

Comments

@kmmago
Copy link

kmmago commented Apr 15, 2025

Describe the feature you'd like supported

MsQuic supports Retry Token mechanism to validate client's address. To generate/validate Retry Token, a key is used as well to add entropy. Ask is to support a configuration path for these keys i.e. keys should be accepted as configuration from some external service. This external service will rotate and send new keys every X seconds.

Proposed solution

This is needed so that Ddos solution and MsQuic solution can share keys. Idea is for ddos and msquic to work in conjunction and use same keys and same encryption APIs so that either can generate a token and both can validate it correctly.

Additional context

No response

@kmmago kmmago added the feature request A request for new functionality label Apr 15, 2025
@nibanks nibanks added this to the Future milestone Apr 16, 2025
@nibanks nibanks added Area: API Area: Security Related to security or quality testing Area: Core Related to the shared, core protocol logic labels Apr 16, 2025
@nibanks
Copy link
Member

nibanks commented Apr 16, 2025

To implement this, we should add a new global parameter, QUIC_PARAM_GLOBAL_RETRY_CONFIG, that takes as input the following info:

  • An CXPLAT_AEAD_TYPE defining the type of key to create
  • The raw bytes (length depend on AEAD type, see CxPlatKeyCreate)
  • The key rotation interval

The secret will need to be stored in MsQuicLib.BaseRetrySecret. The partition logic will need to be updated to account for a configurable AEAD type (instead of hard coded CXPLAT_AEAD_AES_256_GCM) and key rotation interval (instead of the hard coded 30 sec).

We will also need to standardize and document the method for calculating derived keys based on time and base secret. The current logic is:

    uint8_t RawKey[CXPLAT_AEAD_AES_256_GCM_SIZE];
    CxPlatCopyMemory(
        RawKey,
        MsQuicLib.BaseRetrySecret,
        sizeof(MsQuicLib.BaseRetrySecret));
    for (size_t i = 0; i < sizeof(KeyIndex); ++i) {
        RawKey[i] ^= ((uint8_t*)&KeyIndex)[i];
    }

@nibanks
Copy link
Member

nibanks commented Apr 16, 2025

Another thought: if we use a parameter for this, it would be required to be wired up to all the layers on top. For instance, if you want Windows HTTP to take advantage of this, HTTP and possibly IIS would have to be updated.

OR, we have a registry key that backs this as well, though, it's generally not a great idea to store secrets in the registry.

@nibanks nibanks moved this to Planned in DPT Iteration Tracker Apr 24, 2025
@anrossi anrossi self-assigned this Apr 24, 2025
@nibanks nibanks changed the title Configuration support for keys used in Retry Token - to support shareable keys. External DDoS Support for Retry Token Key Configuration Apr 25, 2025
@anrossi
Copy link
Contributor

anrossi commented May 9, 2025

If the app/admin is setting the key directly, then MsQuic wouldn't be generating subkeys from that anymore, right?
So instead of keeping the subkeys, MsQuic would need to store the previous key in memory, once the app/admin sets a new one, and until the app/admin sets the next one, or the time period expires.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: API Area: Core Related to the shared, core protocol logic Area: Security Related to security or quality testing feature request A request for new functionality
Projects
Status: Planned
Development

No branches or pull requests

3 participants