GHSA-8x9r-hvwg-c55h

Suggest an improvement
Source
https://github.com/advisories/GHSA-8x9r-hvwg-c55h
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/04/GHSA-8x9r-hvwg-c55h/GHSA-8x9r-hvwg-c55h.json
JSON Data
https://api.test.osv.dev/v1/vulns/GHSA-8x9r-hvwg-c55h
Aliases
Published
2026-04-04T06:26:02Z
Modified
2026-06-25T19:56:10Z
Severity
  • 8.7 (High) CVSS_V4 - CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N CVSS Calculator
Summary
Code Extension Marketplace: Zip Slip Path Traversal
Details

Zip Slip Path Traversal in coder/code-marketplace

Summary

A Zip Slip (CWE-22) vulnerability in coder/code-marketplace ≤ v2.4.1 allowed a malicious VSIX file to write arbitrary files outside the extension directory. ExtractZip passed raw zip entry names to a callback that wrote files via filepath.Join with no boundary check; filepath.Join resolved .. components but did not prevent the result from escaping the base path.

Root Cause

ExtractZip passed the raw, attacker-controlled zf.Name to a caller-supplied callback:

return false, fn(zf.Name, zr)  // zf.Name not sanitized

AddExtension constructed the output path with filepath.Join and no boundary check:

path := filepath.Join(dir, name)              // zip loop
path := filepath.Join(dir, file.RelativePath) // extra files loop

filepath.Clean resolved .. lexically but did not confine the result to dir:

filepath.Join("/srv/ext/pub/1.0", "../../../../etc/cron.d/evil")
  → "/etc/cron.d/evil"

Attack Scenario

An authenticated user (any upload-capable role) would submit a VSIX containing path-traversal entries.

On extraction, files would land at attacker-chosen paths writable by the marketplace process, enabling persistence (cron/init injection), SSH key injection, ld.so.preload hijacking, or binary overwrite depending on process privileges.

Fix

Addressed in https://github.com/coder/code-marketplace/releases/tag/v2.4.2

Recognition

Coder would like to thank Kandlaguduru Vamsi for responsibly disclosing this issue in accordance with https://coder.com/security/policy

Database specific
{
    "cwe_ids":  [
        "CWE-22"
    ],
    "github_reviewed":  true,
    "github_reviewed_at":  "2026-04-04T06:26:02Z",
    "nvd_published_at":  "2026-04-06T22:16:23Z",
    "severity":  "HIGH"
}
References

Affected packages

Go / github.com/coder/code-marketplace

Package

Name
github.com/coder/code-marketplace
View open source insights on deps.dev
Purl
pkg:golang/github.com/coder/code-marketplace

Affected ranges

Type
SEMVER
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Fixed
1.2.3-0.20260402184705-988440dee05f

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/04/GHSA-8x9r-hvwg-c55h/GHSA-8x9r-hvwg-c55h.json"