Daniel Bae
Menu

Defensive edition

Nexus and the repository paths a service chooses to trust

Daniel BaeOriginally published

SecurityHack The BoxGit

A scheduled importer received repository data and wrote it to disk. The files it could modify extended far beyond its staging directory.

The importer owned the destination

The importer consumed raw repository tree entries. It trusted names that an ordinary Git checkout would reject and could therefore write outside the intended area. The script joined each name onto its staging path and never confirmed that the result stayed inside. An administrative login configuration file was among the files the lab demonstrated it could modify. A clean checkout in a developer’s workspace would miss the behavior of this particular consumer.

The source leaves one question open. It does not establish which account the timer’s service ran as, and an ordinary Git service account would not normally be able to write into an administrator’s home directory. The recorded result shows a privileged write. The service unit’s configured user and the running process’s user ID are the evidence to read. They should not be inferred from the staging directory’s name.

I would constrain each resolved destination to the staging directory, reject absolute names and parent-directory components, and account for symlinks throughout file creation. The importer should also run under an account whose write access ends at staging. A regression check should verify that rejected input leaves files outside that directory untouched.

A password survived its deletion

A public repository’s current revision no longer contained a database password, but its earlier commit still did. The lab also found secrets reused across the application, its supporting services and host accounts. Rotating each reused secret is an incident-response task even if the repository has since become private. Its visibility can change without changing who already knows the password.

What an attachment may become

The CRM, Krayin 2.2.0, accepted an executable attachment from an ordinary authenticated account and stored it where the web server could run it (CVE-2026-38526). The client’s choice of file type was not a server-side decision. A server-side upload allowlist, server-chosen stored names and a storage location with no execution path address different parts of this finding. I would also reduce the credentials readable by the web worker and verify that a normal account can still upload a legitimate document after the changes.