Summary
An authorization flaw in Ghostfolio's public portfolio API allows requests with a private access ID to bypass grantee user filtering and access full portfolio data.
An attacker who obtains or guesses a private access ID can retrieve sensitive investment details, including holdings, quantities, buy prices, and performance metrics, without any authentication.
Affected context
This vulnerability appears in Ghostfolio deployments exposing the /api/v1/public/:accessId/portfolio endpoint.
It manifests when private access IDs are treated as sufficient proof of access without enforcing checks that tie the access ID to a specific grantee user or session.
Environments where access IDs are shared, logged, or guessable are more exposed, particularly if portfolio links are reused or embedded in other systems.
Exploit preconditions
- Attack surface: HTTP GET requests to
/api/v1/public/:accessId/portfolio - Required access: Knowledge or discovery of a valid private
accessId; no login or session required - Trigger point: Submission of a request with a valid
accessIdwhere grantee user constraints are not evaluated - Why exploitation is possible: The endpoint trusts possession of the
accessIdalone and does not enforce authorization logic (e.g.,granteeUserIdmatching) before returning full portfolio contents
Why this happens
The issue stems from missing or incomplete authorization controls on a supposedly public-facing API that still serves sensitive data.
Specifically, the endpoint relies solely on a private accessId token and fails to verify that the requester is an authorized grantee (for example, via granteeUserId filtering or binding the token to a user context).
This aligns with CWE-862: Missing Authorization, where an application does not perform necessary access checks before allowing operations that expose or manipulate protected resources.
Potential impact
- Unauthenticated parties can view full portfolio compositions and holdings
- Exposure of transaction history, buy prices, and performance metrics
- Leakage of inferred financial status or investment strategies of users
- Potential privacy violations and regulatory compliance issues related to financial data
General mitigation guidance
Effective mitigation focuses on enforcing robust authorization checks for all endpoints that return sensitive data, even if they appear "public" by design.
Common patterns include:
- Binding access tokens or IDs to a specific user or grantee identity and validating this relationship on every request
- Implementing explicit authorization middleware for all portfolio-related routes, ensuring least-privilege access
- Treating any identifier used to retrieve sensitive data as secret and time-bound, with rotation and revocation capabilities
- Minimizing the amount of sensitive information exposed via public endpoints and separating anonymous views from detailed financial data
How teams detect issues like this
Detection typically involves reviewing API routes and access control logic to ensure that every protected resource is subject to consistent authorization checks.
Helpful approaches include:
- Static analysis or linting rules that flag controller actions lacking authorization middleware or policy checks
- Code review checklists that require reviewers to confirm authorization enforcement on any endpoint returning user-specific or financial data
- Centralized access control policies (e.g., decorators, filters, or guards) that make missing authorization enforcement more visible
- Logging and monitoring for unusual access patterns to public endpoints that return sensitive portfolio details

