Summary
A missing authentication check in the /api/files/extract-text endpoint of lollms (up to and including version 2.2.0) allows unauthenticated users to upload and process files.
Because this endpoint bypasses the standard get_current_active_user dependency used elsewhere, it can be abused to exhaust server resources, access processed content, and undermine the application's documented security model.
Affected context
The issue occurs in deployments of parisneo/lollms where the /api/files/extract-text endpoint is exposed over a network or the internet.
Unlike other file-related endpoints, this route does not enforce authentication or user context, so any party with network access to the API can invoke it.
The risk is higher in environments with limited resource isolation, shared infrastructure, or assumptions that all file-processing operations are authenticated.
Exploit preconditions
- Attack surface: Network-accessible HTTP API, specifically
/api/files/extract-text - Required access: No authentication required; only the ability to make HTTP requests to the service
- Trigger point: Sending file upload or processing requests to the unauthenticated endpoint
- Why exploitation is possible: The endpoint omits the
Depends(get_current_active_user)dependency, so authorization is never enforced and rate/usage controls may not be tied to a user identity
Why this happens
The vulnerability stems from inconsistent application of authentication and authorization controls across API routes.
While other file-related endpoints use Depends(get_current_active_user) or equivalent mechanisms to ensure only authenticated users can access file-processing features, /api/files/extract-text lacks this dependency.
This maps to CWE-287: Improper Authentication, where the system fails to verify that the caller is an authenticated user before granting access to sensitive or resource-intensive operations.
Potential impact
- Unauthenticated users can upload and process arbitrary files
- Denial of Service (DoS) through repeated or large file-processing requests that exhaust CPU, memory, or storage
- Information disclosure via extraction and retrieval of text content from uploaded files
- Violation of documented security expectations, eroding trust in the application's access control model
- Increased exposure to secondary issues if extracted data is logged, cached, or stored without segregation
General mitigation guidance
Mitigation generally focuses on enforcing consistent authentication and tightening access controls around sensitive or resource-intensive endpoints.
Common defensive patterns include:
- Applying a uniform authentication middleware or dependency (such as
get_current_active_user) to all file-handling and processing routes - Using a centralized route registration or decorator pattern that makes it difficult to accidentally expose unauthenticated endpoints
- Implementing rate limiting and quotas based on authenticated identity, and providing a safe default for unauthenticated traffic (e.g., blocking or heavily throttling)
- Segregating high-cost operations into protected services or internal networks that are not directly exposed to untrusted clients
- Documenting and enforcing security policies at the API boundary, treating undocumented unauthenticated access as a misconfiguration
How teams detect issues like this
Detection typically combines code-level review and runtime monitoring:
- Static analysis / linting: Rules that flag FastAPI (or similar framework) routes handling file uploads or heavy processing that lack authentication dependencies or authorization checks
- Code review signals: Inconsistent use of
Depends(get_current_active_user)or equivalent across similar endpoints; public routes that accept file uploads or large payloads without identity checks - Configuration / policy enforcement: CI pipelines that verify all endpoints in certain namespaces (e.g.,
/api/files/) require authentication, using route introspection or OpenAPI schema validation - Runtime monitoring: Observing anomalous unauthenticated traffic patterns to file-processing endpoints, spikes in CPU/memory usage, or unassociated log entries from anonymous requests

