Summary
PdfDing versions prior to 1.7.0 contain an access-control flaw where the file-serving endpoint for shared PDFs does not properly enforce password checks.
An unauthenticated attacker who knows or can guess a shared file URL can bypass the password verification flow and directly download password-protected documents.
Affected context
The vulnerability affects PdfDing instances that expose shared PDFs via links intended to be protected by a password.
The issue occurs in the file-serving endpoint, which delivers the PDF content after a share link is created.
Instead of consistently verifying that the user has passed the password challenge, the endpoint can be invoked directly, allowing retrieval of files that users believed to be password-protected.
Exploit preconditions
- Attack surface: Publicly reachable PdfDing file-serving endpoint for shared PDFs
- Required access: No authentication or valid password is required; only network access to the instance
- Trigger point: Direct HTTP request to the PDF-serving endpoint associated with a shared file
- Why exploitation is possible: The business logic that protects shared links with a password is not consistently enforced at the final resource endpoint, resulting in missing authorization checks (CWE-863)
Why this happens
The root cause is a missing authorization decision on the resource-serving endpoint.
While the application implements a password-based verification flow for shared links, the final endpoint that delivers the PDF content does not re-check or enforce the user's authorization state.
This creates a broken access control condition described by CWE-863: Incorrect Authorization, where access control is applied to one part of the workflow (password form) but not to the actual protected resource.
As a result, any actor who can construct or reuse the direct file URL can obtain the document without satisfying the intended password gate.
Potential impact
- Unauthorized viewing and downloading of confidential or private PDFs
- Exposure of personal data, contracts, financial records, or other sensitive business documents
- Violation of user expectations and potential non-compliance with privacy or data protection obligations
- Facilitation of data exfiltration if links are guessed, leaked, or logged
General mitigation guidance
Effective mitigation generally relies on enforcing authorization at the resource level rather than only at the UI or workflow level.
Useful defensive patterns include:
- Ensuring every file-serving endpoint performs a fresh authorization check based on the current user/session and the share's protection settings (e.g., password, expiration, ownership).
- Centralizing access-control decisions in a reusable authorization layer rather than scattering checks across controllers and views.
- Treating link passwords as true access-control tokens and verifying them at the point where the file bytes are served, not just when the link is first visited.
- Using defense-in-depth measures such as short-lived signed URLs or tokens that encode authorization context and expire after use or time.
- Applying the principle of least privilege so that unauthenticated or public contexts cannot access endpoints that serve user-owned, sensitive content by default.
How teams detect issues like this
Detection can focus on both design review and automated checks:
- Code review signals: Resource-serving endpoints (e.g., download controllers, file handlers) that do not explicitly call centralized authorization routines or that rely only on prior UI checks.
- Static analysis patterns: Rules that flag endpoints handling sensitive resources when they lack authentication/authorization middleware, guards, or decorators.
- Policy enforcement: Application security policies requiring that all content-serving routes be wrapped with standard authentication and access-control mechanisms, as verified by automated tests.
- Security testing: Targeted access-control tests where password-protected or restricted links are accessed directly, without completing the intended verification flow, including regression tests for all sharing features.
- Runtime monitoring: Logging and alerting on download events from unauthenticated sessions or IPs that have not performed a successful password verification for the corresponding link.

