Skip to content

[BUG] Possible DoS attack vector with forged realm IDs #541

Closed
@adutra

Description

@adutra

Is this a possible security vulnerability?

  • This is NOT a possible security vulnerability

Describe the bug

So this is a bit of a security vulnerability, but it's already public, and we don't have any official release yet, so 🤷‍♂️

It is possible for a malicious actor to cause Polaris to OOM by flooding the server with requests having random realm IDs.

This is possible because a) the default RealmContextResolver does not validate that the realm exists and b) many components maintain an unbounded cache of objects keyed by realm ID, e.g.:

  • RealmScopeContext
  • RealmEntityManagerFactory
  • RealmTokenBucketRateLimiter
  • LocalPolarisMetaStoreManagerFactory

I suggest the following mitigation measures:

  • The default RealmContextResolver MUST validate the realm IDs – which means that we need to persist realms in the database or somewhere else (maybe in configuration?)
  • Any components caching by realm ID should use a bounded cache with proper eviction policies.

To Reproduce

No response

Actual Behavior

No response

Expected Behavior

No response

Additional context

No response

System information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions