Skip to content
Access control Write-up Intermediate

Bypassing the Administrator Page Protection

An unauthenticated attacker could bypass a load-balancer rule protecting the admin path by prefixing it with a language code, then invoke an admin task that writes arbitrary YAML configuration files. This allowed changing site settings and achieving remote code execution via the scheduler or by pointing the cache to an attacker-controlled Redis server.

pentest.blog

Published on pentest.blog

It has been a while since I haven’t published a post on our beloved blog. Today I would like to share technical details and POC for a pretty funny vulnerability that I’ve found at GravCMS.

The author, on pentest.blog

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the admin task dispatcher allowed calling taskSaveDefault without an authorization check, and the data type was derived from a user-controlled URI path that could point to configuration YAML files.

What the attacker needed

Target runs GravCMS with admin plugin; Load-balancer blocks /admin but not /en/admin; Attacker can host a Redis server (for Redis method)

The fix

The vulnerability was fixed in Grav 1.7.10, and a hotfix was applied earlier.

How it was found

  1. Visit the admin URL to obtain a session cookie and extract the admin-nonce value from the login form.
  2. Send a POST request with task=SaveDefault and data fields to write to a configuration YAML file.
  3. For RCE via scheduler, send a POST to /admin/config/scheduler defining a custom job with a command and schedule.
  4. For RCE via Redis, send a POST to /admin/config setting the cache driver to Redis and pointing it to an attacker-controlled server.
  5. Run redis-cli monitor to capture incoming data and find an administrator session key.
  6. Use the admin session to access /admin/tools/direct-install and upload a malicious plugin.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

The website's admin area was supposed to be blocked by a network filter, but adding a language code like /en/ in front of /admin tricked the filter. Once inside, a function meant to save settings could be called without logging in, letting an attacker change configuration files. Those files control features like scheduled commands, which can run code on the server.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.