Skip to content

Consider alternative color parsing library #4450

@mrginglymus

Description

@mrginglymus

ref: #4449, e18e/ecosystem-issues#203

Sharp currently depends on color@^4.2.3. This package depends transitively on simple-swizzle, a library which has been recommended against being used by the author for at least three years, and was recently compromised.

Whilst color@^5.0.0 has removed its transitive dependence on simple-swizzle, it has also gone esm only, which is incompatible with the supported node versions of this library.

For completeness then, there are three options I can see:

  1. do nothing - none of the packages are currently vulnerable, and all will continue to work. However, there is a reasonable chance that simple-swizzle will be marked as deprecated, which may trigger warnings for downstream users
  2. update minimum supported version of node, update to color@^5.0.0. As mentioned earlier, this is not acceptable
  3. update to a new color parsing library that does not pull in so many dependencies, and still supports cjs.

The hardest part of 3. will be finding which of the hundreds of color parsing libraries out there is best fit ;)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions