/

CVE-2026-27833

Severity:

HIGH RISK

(7.5)

Missing Authorization in Piwigo pwg.history.search API

CVE-2026-27833

Analyzed

Vulnerability type

Category:

Missing Authorization

CWE:

CWE-862

Impact:

Unauthorized Access to Sensitive User Activity Data

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A missing authorization check in Piwigo's pwg.history.search API allows unauthenticated users to query the complete browsing history of gallery visitors.

When exposed, this endpoint can leak sensitive behavioral and potentially identifying information about users' interactions with the photo gallery.

Affected context

This vulnerability affects Piwigo deployments where the pwg.history.search API endpoint is reachable from the network (e.g., public or internal web access).

The issue occurs because the method is registered without the admin_only (or equivalent access control) flag, meaning no authentication or role check is enforced before returning browsing history data.

Any HTTP client capable of reaching the Piwigo API can query the viewing history of gallery visitors, regardless of whether the gallery itself requires login to browse images.

Exploit preconditions

  • Attack surface: Piwigo web API, specifically the pwg.history.search method.
  • Required access: Network access to the Piwigo instance; no authentication or valid user session is required.
  • Trigger point: Sending a crafted request to pwg.history.search (e.g., via HTTP POST/GET with appropriate parameters).
  • Why exploitation is possible: The API method is registered without an admin_only or equivalent authorization requirement, resulting in an unprotected endpoint that exposes sensitive history data.

Why this happens

The root cause is a missing authorization control on a sensitive backend function, aligning with CWE-862: Missing Authorization.

The API registration logic treats pwg.history.search as a generic method and omits the flag or configuration that limits access to administrative or authenticated users.

As a result, the access control layer never checks whether the caller has sufficient privileges before serving detailed browsing history, violating the principle of least privilege and exposing data that should be restricted.

Potential impact

  • Exposure of detailed browsing history for all gallery visitors, including which images or albums they viewed and when.
  • Inference of user interests, habits, or behavioral patterns that may be sensitive in certain contexts (e.g., private or themed galleries).
  • Potential de-anonymization when browsing history can be correlated with IP addresses, usernames, or session identifiers.
  • Increased risk of targeted social engineering or harassment based on observed viewing behavior.
  • Privacy non-compliance where regulations or policies require protection of user activity logs.

General mitigation guidance

Effective mitigation focuses on enforcing explicit authorization on sensitive API endpoints and treating history/audit data as protected resources.

Pattern-based defensive measures include:

  • Defining a clear access-control policy for all API methods, especially those exposing logs, history, or analytics.
  • Requiring authentication and appropriate roles (e.g., admin, auditor) for any endpoint that returns other users' activity.
  • Centralizing API registration or routing so that endpoints must declare their authorization requirements (e.g., admin_only, authenticated_only) and defaulting to "deny" when not specified.
  • Applying the principle of least privilege by returning only the minimum necessary information and, where appropriate, aggregating or anonymizing history data.
  • Conducting security reviews of new or modified API methods to ensure that changes to access control are intentional and documented.

How teams detect issues like this

Organizations can identify similar issues using a combination of design review, code analysis, and runtime monitoring:

  • Static analysis & code scanning: Flag API registration calls where authorization flags (such as admin_only or role requirements) are absent for methods operating on sensitive data.
  • Manual code review: Inspect controllers, route definitions, and API handlers to confirm that every endpoint passes through a centralized authorization layer, and that history/log-related methods require privileged roles.
  • Configuration and policy checks: Enforce architectural rules that no endpoint may bypass the authentication/authorization middleware; violations should be treated as build or deployment blockers.
  • Runtime monitoring: Analyze access logs for patterns where sensitive endpoints (e.g., history, audit, analytics APIs) are frequently accessed by unauthenticated or anonymous clients, which may indicate missing controls.
  • Automated API security testing tools can also help discover unauthenticated access paths to sensitive methods during pre-production testing.

Sources

SourceLink
github.comgithub.com/Piwigo/Piwigo/commit/d05c16561ce3692ca922199f8c8d7b1a45893f1c
github.comgithub.com/Piwigo/Piwigo/security/advisories/GHSA-397m-gfhm-pmg2
piwigo.orgpiwigo.org/release-16.3.0

Frequently asked

questions

Yes. If the Piwigo instance is reachable over the network, an unauthenticated remote user can query the pwg.history.search API and obtain browsing history data.

Only basic network access to the Piwigo API is required. No user account, session, or prior authentication is needed to exploit the missing authorization on this endpoint.

Apply strict authorization to the pwg.history.search method, limiting it to trusted roles (such as administrators), and ensure that all similar endpoints explicitly declare and enforce their access requirements via a centralized authorization mechanism.

Adopt a secure-by-default access control model where new API endpoints are denied access unless they explicitly specify their allowed roles, enforce mandatory use of authentication/authorization middleware, and incorporate access-control checks into code review and automated testing processes for any changes involving sensitive data.

Find out what's already
exploitable in your codebase.