MicroCeph path traversal issue in the remote-import API
Description
Canonical MicroCeph versions from the squid and tentacle track are vulnerable to a path traversal issue in the remote-import API. Holders of a trusted cluster mTLS certificate (such as enrolled cluster members) or join token can manipulate files in an imported remote cluster within the /var/snap/microceph confinement. This would allow daemon disruption and pollution of the cluster state.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Affected products
1Patches
Vulnerability mechanics
Root cause
"Missing input validation on remote names in the remote-import API allows path-traversal characters to reach file write/delete operations."
Attack vector
An attacker who holds a trusted cluster mTLS certificate (e.g., an enrolled cluster member) or a valid join token can send a crafted HTTP request to the remote-import API with a remote name containing path-traversal sequences such as `../state`. Because the API previously did not validate the remote name, the traversal payload reaches file operations like `renderConfAndKeyringFiles` and `os.Remove`, allowing the attacker to write or delete files under `/var/snap/microceph`. This can disrupt Ceph daemons and corrupt cluster state. The attack requires network access to the MicroCeph API and valid cluster credentials [patch_id=6590900].
Affected code
The vulnerability resides in the remote-import API endpoints (`microceph/api/remote.go`) and the file-writing helpers (`microceph/ceph/configwriter.go`, `microceph/database/remote_extras.go`). The `cmdRemotePut`, `cmdRemoteGet`, and `cmdRemoteDelete` handlers lacked validation of remote names, allowing path-traversal characters such as `../` to reach `renderConfAndKeyringFiles` and `os.Remove` calls. The patch adds `validateRemoteName` and `validateRemoteImportRequest` functions that reject names containing `..`, `/`, or reserved words, and hardens `Config.WriteConfig` and `DeleteRemoteDb` with `filepath.IsLocal` checks.
What the fix does
The patch introduces `validateRemoteName` and `validateRemoteImportRequest` in `microceph/api/remote.go` to reject remote names that contain characters outside `[a-z0-9]`, include path separators (`/`), or match reserved names (`ceph`, `ganesha`, `radosgw`). It also adds `filepath.IsLocal` checks in `Config.validateConfigFile` (`microceph/ceph/configwriter.go`) and `DeleteRemoteDb` (`microceph/database/remote_extras.go`) to ensure that constructed file paths cannot escape the intended directory. The `ClusterNameRegex` is tightened to enforce a maximum length of 63 characters, and the `IsValidClusterName` helper is extracted to a reusable function. Together these changes prevent an authenticated attacker from writing or deleting files outside the `/var/snap/microceph` confinement via the remote-import API.
Preconditions
- authAttacker must possess a trusted cluster mTLS certificate (e.g., enrolled cluster member) or a valid join token.
- networkAttacker must have network access to the MicroCeph API endpoint.
- configThe vulnerable remote-import API endpoint must be exposed and reachable.
Generated on Jun 19, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
1News mentions
0No linked articles in our index yet.