Skip to content

[SECURITY]: Secure Publicly Exposed Actuator and AI Endpoints (Denial of Wallet Risk) #1361

@pulkit1245

Description

@pulkit1245

Vulnerability Description

While reviewing SecurityConfig.java, I discovered an improper authorization vulnerability where sensitive and cost-incurring endpoints are exposed to the public internet without any authentication checks.

Specifically:

  1. Spring Boot Actuator Exposed: The path /actuator/** is configured with .permitAll(). This exposes the application's internal management endpoints.
  2. Unauthenticated AI Endpoints: Paths such as /ai/summarize, /ai/chat, and /ai/chat/ollama are also configured with .permitAll(). These endpoints interface with third-party LLM providers (e.g., OpenAI, Gemini), which charge per request/token.

I am participating in GSSoC '26 and would like to submit a Pull Request to fix this by restricting the /actuator/** endpoints to an ADMIN role and securing the /ai/** endpoints behind standard JWT authentication.

Impact

  1. Information Disclosure (Actuator): By leaving the actuator endpoints unprotected, an attacker can access /actuator/env to read sensitive environment variables (such as API keys and database credentials) or /actuator/heapdump to download memory dumps containing sensitive user session data.
  2. Denial of Wallet / Financial Loss (AI Endpoints): Because the AI endpoints are unauthenticated, a malicious actor can script a bot to send thousands of requests to the LLM APIs without needing a valid user account. This would quickly consume API quotas and result in massive, unexpected financial charges for the project maintainers.

Reproduction Steps

  1. Start the backend application locally.
  2. Open a terminal and run a simple curl command against the actuator environment endpoint without providing any Authorization headers:
    curl -X GET http://localhost:8080/actuator/env
  3. Observe that the server returns the environment properties instead of a 401 Unauthorized response.
  4. Similarly, make a POST request to an AI endpoint without a token:
    curl -X POST http://localhost:8080/ai/chat -H "Content-Type: application/json" -d '{"message": "Hello"}'
  5. Observe that the request is processed and sent to the LLM provider instead of being blocked.

Severity Level

Critical

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions