Skip to main content
Menu
Advisories

getgrav/grav-plugin-admin2 information disclosure

GHSA-PFJQ-CHP8-3VGHPublished Updated GitHub

Description

The Admin2 SPA bootstrap page at /grav/admin embeds a global JavaScript variable window.__GRAV_CONFIG__ containing the server URL, API prefix, admin base path, runtime environment type, and exact Grav version. This object is served in every unauthenticated response and provides attackers with a precise technology fingerprint - including the exact version needed for exploit selection - without requiring any authentication or reconnaissance effort.

Details

Every request to /grav/admin (including /admin/* subroutes for the SPA) returns this inline <script> block:

<script>window.__GRAV_CONFIG__ = {
  "serverUrl":  "http://127.0.0.1/grav",
  "apiPrefix":  "/api/v1",
  "basePath":   "/grav/admin",
  "environment": "localhost",
  "grav":       {"version": "2.0.0"},
  "admin":      {"name": "Admin2", "version": "2.0.1"}
};</script>

Each field aids an attacker:

FieldAttack Value
serverUrlTells the attacker the full origin for API calls — no guesswork
apiPrefixReveals the API is at /api/v1 — direct targeting
basePathConfirms the admin panel path
environment"localhost" signals a development/testing deployment with potentially weaker hardening
grav.version"2.0.0" — attacker knows exactly which CVEs and known exploits to try
admin.version"2.0.1" — narrows admin-specific attack surface

The object is embedded in the HTML source, not loaded from an external file, so it cannot be blocked by CSP or fetched separately. It is present on every response including 404s at admin subroutes.

PoC

curl -s "http://127.0.0.1/grav/admin" | grep -oP 'window\.__GRAV_CONFIG__\s*=\s*\K\{[^}]+\}'
# {"serverUrl":"http://127.0.0.1/grav","apiPrefix":"/api/v1","basePath":"/grav/admin","environment":"localhost","grav":{"version":"2.0.0"},"admin":{"name":"Admin2","version":"2.0.1"}}

# Also present on any admin subroute (no auth required):
curl -s "http://127.0.0.1/grav/admin/does-not-exist" | grep -oP '"version":"[^"]+"'
# "version":"2.0.0"
# "version":"2.0.1"

Impact

Information disclosure aiding targeted attacks. Any unauthenticated visitor receives the exact Grav and Admin2 version numbers, the API prefix, and the environment type in a single, trivially parseable JSON object embedded in the page source. This eliminates the reconnaissance phase for an attacker - they immediately know which exploits to attempt against Grav 2.0.0 / Admin2 2.0.1 without probing for version-specific behavior or error messages.

Affected versions

References

GitHub · getgrav/grav