color-convert known bugs

npm

6 known bugs in color-convert, with affected versions, fixes and workarounds. Sourced from upstream issue trackers.

6
bugs
Known bugs
SeverityAffectedFixed inTitleStatusSource
high3.1.13.1.2
[email protected] contains malware after npm account takeover
### Impact On 8 September 2025, the npm publishing account for `color-convert` was taken over after a phishing attack. Version `3.1.1` was published, functionally identical to the previous patch version, but with a malware payload added attempting to redirect cryptocurrency transactions to the attacker's own addresses from within browser environments. Local environments, server environments, command line applications, etc. are not affected. If the package was used in a browser context (e.g. a direct `<script>` inclusion, or via a bundling tool such as Babel, Rollup, Vite, Next.js, etc.) there is a chance the malware still exists and such bundles will need to be rebuilt. The malware seemingly only targets cryptocurrency transactions and wallets such as MetaMask. See references below for more information on the payload. ### Patches npm removed the offending package from the registry over the course of the day on 8 September, preventing further downloads from npm proper. On 13 September, the package owner published new patch versions to help cache-bust those using private registries who might still have the compromised version cached. This version is functionally identical to the previously known-good version, published as a patch version bump above the compromised version. Users should update to the latest patch version, completely remove their `node_modules` directory, clean their package manager's global cache, and rebuild any browser bundles from scratch. Those operating private registries or registry mirrors should purge the offending versions from any caches. ### References - https://www.aikido.dev/blog/npm-debug-and-chalk-packages-compromised - https://socket.dev/blog/npm-author-qix-compromised-in-major-supply-chain-attack - https://www.ox.security/blog/npm-packages-compromised/ ### Point of Contact In the event suspicious behavior is still observed for the package listed in this security advisory after performing all of the above cleaning operations (see _Patches_ above), please reach out via one of the following channels of communication: - Bluesky, package owner: https://bsky.app/profile/bad-at-computer.bsky.social - `debug` repository, tracking issue (applies to all packages affected in the breach): https://github.com/debug-js/debug/issues/1005
fixedosv:GHSA-pxx3-g568-hxr4
mediumany\u2014
backward conversion isn't accurate
You can try in node REPL: `'A1C9FF' !== 'A1CAFF'` ``` > var conf = require('color-convert') undefined > conv.hex.hsv('A1C9FF') [ 214, 37, 100 ] > conv.hsv.hex([214,37,100]) 'A1CAFF' > conv.hsv.hex([214,37,100]) ```
fixedgithub:41
mediumany\u2014
Hue component of HCG color is wrong by 120° then converting from RGB or CMYK
Steps to reproduce === Here we are converting from RGB to HCG and then back. Note color components are very far apart. > var convert = require('color-convert') > convert.hcg.rgb.raw(convert.rgb.hcg.raw([250, 0, 255])) [ 0, 255, 249.99999999999991 ] Description === Then converting color to HCG from RGB or CMYK Hue component of the color appears to be offset by 120°. Current behavior === > var convert = require('color-convert') > convert.rgb.hcg.raw([250, 0, 255]) [ 178.8235294117647, 100, 0 ] Expected behavior === > var convert = require('color-convert') > convert.rgb.hcg.raw([250, 0, 255]) [ 298.8235294117647, 100, 0 ] Cause? === https://github.com/Qix-/color-convert/blob/master/conversions.js#L668 4 is added twice. This is most likely it, but I'm not 100% sure.
fixedgithub:73
medium2.0.1\u2014
inaccurate ansi256 conversion
Thanks for this awesome library! It seems like converting `#282629` returns `59` (`#5f5f5f`). ```javascript console.log(convert.hex.ansi256('#282629')); ``` However, I think `235` (`#262626`) is a better 256-color approximation of `#282629`. I'm using 2.0.1 of `color-convert`.
fixedgithub:74
mediumany\u2014
error when convert.keyword.rgb. Cannot assign to read only property '0' of object '[object Array]' in wrappedFn
Running the tests in this project also fail for me at `assert.deepStrictEqual(convert.keyword.rgb('blue'), [0, 0, 255]);` ``` file:///Users/pmcw/Documents/development/color-convert/color-convert/index.js:49 result[i] = Math.round(result[i]); ^ TypeError: Cannot assign to read only property '0' of object '[object Array]' at Object.wrappedFn [as rgb] (file:///Users/pmcw/Documents/development/color-convert/color-convert/index.js:49:15) at file:///Users/pmcw/Documents/development/color-convert/color-convert/test/basic.js:92:40 at ModuleJob.run (node:internal/modules/esm/module_job:343:25) at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:665:26) at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:117:5) ```
fixedgithub:124
mediumany\u2014
Malicious code in color-convert (npm)
The package was compromised and malicious code added. --- _-= Per source details. Do not edit below this line.=-_ ## Source: ghsa-malware (71ee3370ed9cf22bf89fbf40c954408a6ddcd17fbd38750027a2b7fab6034bce) Any computer that has this package installed or running should be considered fully compromised. All secrets and keys stored on that computer should be rotated immediately from a different computer. The package should be removed, but as full control of the computer may have been given to an outside entity, there is no guarantee that removing the package will remove all malicious software resulting from installing it.
openosv:MAL-2025-46971
API access

Get this data programmatically \u2014 free, no authentication.

curl https://depscope.dev/api/bugs/npm/color-convert
color-convert bugs — known issues per version | DepScope | DepScope