Summary
QAnything contains an authentication bypass in document retrieval endpoints, allowing unauthenticated users to access uploaded files and parsed document content without ownership checks. An attacker who can enumerate file identifiers may disclose knowledge base data across tenants.
Affected context
The vulnerability occurs in QAnything's local document question-answering API when file retrieval endpoints accept requests without consistently enforcing authentication and ownership authorization. Deployments are at risk when these endpoints are exposed to untrusted users and document identifiers can be discovered or enumerated.
Exploit preconditions
- Attack surface: HTTP API endpoints used to retrieve uploaded files and parsed document content
- Required access: No valid authentication is required by the vulnerable request paths
- Trigger point: Requests to the file base64 and document retrieval endpoints
- Why exploitation is possible: The endpoints can disclose content after receiving a valid or discoverable file identifier without verifying the caller's identity, tenant, or ownership
Why this happens
The underlying defect is a missing authentication and authorization check on sensitive document retrieval operations. The application treats an identifier as sufficient authority to access a resource instead of deriving the caller's identity from a trusted authentication context and enforcing ownership or tenant boundaries. This behavior maps to CWE-306: Missing Authentication for Critical Function and also reflects inadequate object-level access control.
Potential impact
- Unauthenticated attackers may retrieve uploaded files
- Sensitive documents and parsed knowledge base chunks could be disclosed
- Cross-tenant information exposure may occur
- Exposed content could support further targeted attacks or data harvesting
- Organizations may face privacy, compliance, and confidentiality impacts
General mitigation guidance
Mitigation typically focuses on enforcing authentication and object-level authorization for every document retrieval operation.
Common defensive patterns include:
- Require a verified authenticated identity before processing retrieval requests
- Check that the requested file belongs to the authenticated user, tenant, or authorized knowledge base
- Avoid treating client-supplied identifiers as authorization evidence
- Use opaque, access-controlled identifiers and limit identifier enumeration
- Apply least-privilege service permissions and tenant-isolation policies
- Return consistent responses and apply rate limits to reduce resource enumeration
- Log and monitor denied and successful document-access events
How teams detect issues like this
Organizations commonly detect this class of issue through:
- Static analysis and API security rules that identify sensitive routes lacking authentication middleware
- Code review checks for missing ownership or tenant authorization near file retrieval logic
- Integration tests that access resources using unauthenticated and cross-tenant identities
- API gateway policies requiring authentication for document and file endpoints
- Runtime monitoring for unusual identifier enumeration and repeated retrieval failures
Automated application security testing can help verify that authorization is enforced consistently across equivalent retrieval paths.

