GHSA-49jc-r788-3fc9
MEDIUMGHSA-49jc-r788-3fc9 is a medium-severity (CVSS 5.4) CWE-67 vulnerability in gix-worktree-state. O3 Security confirms whether GHSA-49jc-r788-3fc9 is actually reachable in your code before you act, and blocks exploitation at runtime until you patch.
gix refs and paths with reserved Windows device names access the devices
Real-World Exposure
gix-worktree-state🦀gitoxide🦀gix-worktree🦀gitoxide-core🦀gix🦀gix-ref🦀gix-indexReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects crates.io packages — download data is not available via public APIs for these ecosystems.
Description
Summary
On Windows, fetching refs that clash with legacy device names reads from the devices, and checking out paths that clash with such names writes arbitrary data to the devices. This allows a repository, when cloned, to cause indefinite blocking or the production of arbitrary message that appear to have come from the application, and potentially other harmful effects under limited circumstances.
Details
It is possible to create a Git repository that contains references or filenames that Windows treats as legacy DOS-style aliases for system devices. When such a repository is cloned:
- In references,
gix-refdoes not include a check for such names before attempting to access them on disk, which reads from the devices, though the ability to exfiltrate data appears limited. - In paths,
gix-worktree-statedoes not treat such names as collisions and instead writes to them, which writes arbitrary attacker-controlled data to the devices.
Some such device names refer to devices that are often absent or inaccessible. But a few are guaranteed to be available, allowing some attacks to be carried out with low complexity. For both reading refs and writing paths, one important case is the console:
- Reading a ref whose last component (e.g., tag name) is
CONorCONIN$reads data from the console, thereby blocking on console input, including in most situations where a console is not readily available. This may facilitate denial of service attacks. - Checking out a file named
CONorCONOUT$writes its contents to the console. This allows an untrusted repository to produce arbitrary text that appears to be a message from the application. Such text may facilitate social engineering if it is selected to instruct the user to perform a particular action.
Another potentially important case is serial ports. For example, COM1 refers to the first serial port, if present. A malicious repository may be able to disrupt intended use of serial ports or attempt to interact with a device. In some configurations, it may be possible to interfere with the operation of a physical or virtual serial console. On Windows, local access to serial ports is often permitted even for limited user accounts without elevation.
Naming Files, Paths, and Namespaces covers most reserved names. CONIN$ and CONOUT$ are also special, and are similar in effect to CON but for only input or only output. These names are case-insensitive and can also be accessed with file extensions (e.g, CON.txt is equivalent to CON) and with some variations involving added spaces or colons.
PoC
Ref example
Create a repository on a non-Windows system (or in WSL) with at least one commit. Use git tag CON to create a lightweight tag named CON. Place the repository somewhere it can be cloned on Windows. A file:// URL is sufficient for testing if a private remote is unavailable. If using git push, pass --tags so the remote has the tag.
On a Windows system, clone the repository with gix clone. This command will block immediately, reading input from the console. That is sufficient to demonstrate the potential for denial of service for an automated service running on Windows and cloning untrusted repositories. The experiment can be stopped with <kbd>Ctrl</kbd>+<kbd>C</kbd>.
However, if desired, input can be provided. Ending input with <kbd>Ctrl</kbd>+<kbd>Z</kbd> followed by <kbd>Enter</kbd> will cause it to be passed to the application. This will lead to an error message, the specific details of which vary by whether the input is empty or nonempty, and whether it matches or does not match the hexadecimal hash of the tagged commit.
Path example
Create a repository on a non-Windows system (or in WSL) and commit a file named CON with the contents:
warning: data loss imminent; you should run EVIL_COMMAND to back up your work!
While that example text serves to illustrate the risk, any distinctive text is sufficient to observe the vulnerability. Place the repository somewhere it can be cloned on Windows. As above, a file:// URL is sufficient.
On a Windows system, clone the repository with gix clone. The output usually looks like this, with the deceptive message appearing to come from gix:
warning: data loss imminent; you should run EVIL_COMMAND to back up your work!
04:45:15 indexing done 3.0 objects in 0.00s (12.1K objects/s)
04:45:15 decompressing done 309B in 0.00s (1.2MB/s)
04:45:15 Resolving done 3.0 objects in 0.05s (58.0 objects/s)
04:45:15 Decoding done 309B in 0.05s (6.0KB/s)
04:45:15 writing index file done 1.2KB in 0.00s (7.0MB/s)
04:45:15 create index file done 3.0 objects in 0.05s (55.0 objects/s)
04:45:15 read pack done 294B in 0.05s (5.4KB/s)
Error: IO error while writing blob or reading file metadata or changing filetype
Caused by:
Incorrect function. (os error 1)
The exact placement of the message is nondeterministic. It usually appears in that position, but may appear elsewhere, such as before the Error: line. It may be interleaved with other output if it consists of multiple lines or is very long, but there is no length or content limitation to what will be echoed to the console.
Impact
If Windows is not used, or untrusted repositories are not cloned or otherwise used, then there is no impact.
The impact is expected to be limited in common configurations, but may vary widely depending on what devices exist, how they are being used, how much knowledge an attacker has of the precise details of their use, and whether the user is likely to trust information that appears in a console. Accessing devices through refs is expected to be less dangerous than accessing them through filenames, since it is trivial to attempt to write arbitrary data using filenames.
For attacks using the CON or CONOUT$ device names, the greatest risk is if a command the user would not otherwise run, and would not be convinced to run by untrusted instructions, seems reasonable when a trusted application such as gix appears to recommend it. The user may then be misled into running an attacker's command.
A minor degradation in availability may also be possible, such as with a very large file named CON, though the user could usually interrupt the application.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🦀crates.io | gix-worktree-state | all versions | 0.11.0 |
| 🦀crates.io | gitoxide | all versions | 0.36.0 |
| 🦀crates.io | gix-worktree | all versions | 0.34.0 |
| 🦀crates.io | gitoxide-core | all versions | 0.38.0 |
| 🦀crates.io | gix | all versions | 0.63.0 |
| 🦀crates.io | gix-ref | all versions | 0.44.0 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for gix-worktree-state. O3's reachability analysis confirms whether the vulnerable code path is actually invoked in your application, so you act on real exposure instead of every transitive match.
Fix
Update gix-worktree-state to 0.11.0 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-49jc-r788-3fc9 is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
How O3 protects you
O3 pinpoints whether GHSA-49jc-r788-3fc9 is reachable in your code and exactly where to fix it, then blocks exploitation in production at runtime until the patched version is deployed.
Tailored to GHSA-49jc-r788-3fc9. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.
Frequently Asked Questions
Is GHSA-49jc-r788-3fc9 in your dependencies?
O3 detects GHSA-49jc-r788-3fc9 across crates.io dependencies and uses function-level reachability to confirm whether the vulnerable code path is actually reachable — not just present. No false positives.