Skip to content

EncryptedAnalyticsController: open CORS *, no authorization/scoping, client-supplied modulus, and unconditional homomorphicPropertyVerified #16255

Description

@ionfwsrijan

Severity

Medium — Missing authorization + misleading "encrypted" analytics

Location

  • Backend/src/main/java/com/sandeep/eventrabackend/security/EncryptedAnalyticsController.java:12,32-42

Description

The encrypted-analytics compute endpoint:

  • Has @CrossOrigin(origins = "*") and no @PreAuthorize/role check, so it is reachable by any authenticated user (and from any origin).
  • Takes a client-supplied modulusN and returns homomorphicPropertyVerified: true unconditionally.

The server holds no use of a private key here, so no actual confidentiality is provided; the endpoint is effectively a public homomorphic calculator that also accepts unbounded ciphertexts (cheap DoS) and is open to all origins.

Impact

  • Unbounded computation (DoS) open to any origin.
  • False sense of privacy / "verified" analytics.

Suggested fix

Require appropriate role/event scoping, remove wildcard CORS, validate/limit input size, and only return verified when the server actually performed the verification.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions