[Security] Using the latest shiki library could introduce dependency risk for users #4376
Replies: 1 comment 4 replies
-
FWICT, the oniguruma-to-es library and its dependencies are only used if you manually choose the synchronous engine in Shiki. For most users, these libraries won’t affect their setup. While postinstall scripts could potentially pose a risk, these dependencies don’t include any, and in security-critical environments, it's good practice to configure your package manager to block untrusted scripts. For example, pnpm.onlyBuiltDependencies achieves this in pnpm, while npm and yarn offer similar controls, as detailed here. Bun and Deno do this by default. Regarding the concern about "fairly unused packages," I don’t think this is a valid issue in this case. Dependencies specifically created to support another library naturally have low usage metrics initially. Over time, they may grow in adoption as they prove their stability and utility. Moreover, Anthony (Shiki’s maintainer) has been collaborating with slevithan for several months now, and evidently trusts their work, as Regex+—another of their libraries—was already a key part of Shiki’s dependency tree. From what I’ve seen, the code in these dependencies is not obfuscated, meaning it’s open for anyone to review. If there are actual vulnerabilities or concerns, they can and should be reported. Finally, for users who are still wary, the synchronous engine is experimental and optional. It won’t become the default without rigorous testing across projects. |
Beta Was this translation helpful? Give feedback.
-
Please see: shikijs/shiki#843
TL;DR -- the latest update to Shikijs includes some new dependencies that are not used much and also have the same single maintainer. This may introduce dependency risk as this is such a high used library
Beta Was this translation helpful? Give feedback.
All reactions