Skip to content
Access control Write-up Intermediate

A Deep Dive into a Critical Vulnerability in Clockwork

Clockwork's localhost restriction could be bypassed by setting the Host header to a trusted domain, allowing unauthorised access to debugging information. An attacker could use this to read logs containing magic-link tokens and hijack an admin session.

medium.com

Published on medium.com

Hello, readers! Today, I want to share a fascinating journey I embarked on, uncovering a critical vulnerability in a popular PHP development tool called Clockwork.

0vulns πŸ‡ΈπŸ‡©, on medium.com

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

The application trusted the Host header to decide whether a request came from localhost, without verifying the actual network origin.

Impact

An attacker could gain unauthorised access to debugging information, leading to session hijacking and potentially full site takeover.

What the attacker needed

Clockwork enabled in debug mode; Attacker can reach the origin IP; Victim has an account

How it was found

  1. Find the server's origin IP address.
  2. Send an HTTP request with a Host header set to a trusted domain.
  3. Access the Clockwork endpoint to read debugging information.
  4. Retrieve researcher emails from an unauthenticated endpoint.
  5. Send a magic link to an admin's email.
  6. Extract the token from Clockwork logs and log in as the admin.

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.

Clockwork is a debugging tool for PHP developers that shows detailed information about web requests. It was supposed to only work when accessed from the developer's own computer, but the check could be fooled by pretending the request came from a trusted address. This let an outsider read the debugging logs, which contained secret login links.

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.