Cachet 2.4: Code Execution via Laravel Configuration Injection
Cachet's settings interface allowed authenticated users to inject newline characters into .env configuration values, enabling arbitrary PHP code execution via Laravel's unserialize of sessions. A related flaw let attackers leak secrets like APP_KEY, and a forced reinstall bug allowed bypassing setup restrictions.
blog.sonarsource.com
Published on blog.sonarsource.com
Status pages are now an essential service offered by all Software-as-a-Service companies (we do it too!). To help their adoption, startups quickly conceived status pages as-a-service, and open-source self-hosted alternatives were made available.
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
Impact
An attacker with basic user privileges could achieve remote code execution and full server compromise, though admin credentials are not required for the first vulnerability.
What the attacker needed
A valid user account with basic privileges
The fix
The newline injection was fixed by rejecting any modification containing newline characters in the configuration handler.
How it was found
- Log in with a basic user account.
- Go to the email settings page.
- Submit a value containing newlines to inject a new configuration entry.
- The injected entry changes the cache driver to a malicious Redis server.
- Laravel unserializes session data from the malicious server, leading to code execution.
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.
Cachet is a status page tool. Its settings page let users change configuration values, but it didn't check for newlines. By adding extra lines, an attacker could change how the app runs and execute code on the server.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.