Summary
Grav Lightbox Gallery can invoke media methods named in certain shortcode values without applying Grav core's allowed-action check. A page editor who can craft these values may expose server-readable YAML file contents in a publicly viewable page.
Affected context
The issue is described for Grav Lightbox Gallery 1.1.0 before 1.3.2 on Grav 2.x. It occurs when the plugin processes image, thumb, or thumb_options shortcode values and calls a named media method without the core allowed-action check. Risk depends on whether an editor can create or modify such shortcodes and whether resulting pages are publicly accessible.
Exploit preconditions
- Attack surface: Lightbox Gallery shortcodes processed by a Grav site
- Required access: Ability to edit a page or otherwise control the relevant shortcode values
- Trigger point: Rendering a page containing the crafted shortcode
- Why exploitation is possible: The plugin calls named media methods without applying the core allowed-action check, enabling a method chain to place readable file contents into page output
Why this happens
The plugin performs dynamic method dispatch based on shortcode values without enforcing the same allowed-action restrictions as Grav core. This can let an editor chain media methods to access and serialize server-readable YAML content into a page. The resulting exposure of information to parties who should not have access maps to CWE-200: Exposure of Sensitive Information to an Unauthorized Actor.
Potential impact
- Account password hashes, 2FA secrets, or API keys may be exposed if stored in readable YAML files.
- Sensitive configuration data could be published to visitors of an affected page.
- Exposed credentials or secrets could enable further unauthorized access, depending on their scope and validity.
General mitigation guidance
Defensive patterns focus on limiting which operations shortcode input can invoke and reducing the sensitivity of data available to the application.
- Use explicit allowlists for methods callable through shortcode values; avoid unrestricted dynamic dispatch.
- Validate shortcode inputs against a strict schema and reject unsupported values before processing.
- Keep secrets out of files that the web application can read where practical, and use dedicated secret-management controls.
- Restrict editor privileges and separate content-authoring permissions from access to sensitive configuration.
- Apply least privilege to the application process and avoid exposing sensitive data in rendered output.
How teams detect issues like this
- Review code for dynamic method calls derived from shortcode or other user-controlled values.
- Check whether plugin paths enforce the same action allowlists and authorization checks as core components.
- Search for method chains that can read, serialize, or render local files into page content.
- Test shortcode handling with policy checks that verify unsupported methods and sensitive file access are rejected.
- Use static analysis and automated code review checks to flag user-controlled method dispatch and file-to-response data flows.

