stylekit
Audited by Socket on Aug 16, 2026
3 alerts found:
Anomalyx2SecurityNo direct signs of runtime malware are present in the shown fragment. The primary risk is that this is a generator that interpolates (apparently) untrusted style metadata into generated TS/TSX source and uses slug directly in dynamic import specifiers. Without strict allowlisting/validation (especially for slug and safe hex/color formats) and consistent context-aware escaping for generated code, an attacker could induce build-time/code-generation injection or unintended module loading within the styles area. Recommend enforcing slug patterns (e.g., strict [a-z0-9-]+), validating colors as proper hex, and applying robust escaping/sanitization (or structured AST generation) before embedding values into TS/TSX source.
This code is designed as a CI lint runner, not as a stealthy malware component. However, it contains high-impact unsafe execution patterns: it uses execSync with shell-string interpolation of environment variables for file discovery, and it constructs a `tsx -e` command that embeds both environment-derived values and entire file contents into a JavaScript template literal with insufficient escaping. If an attacker can influence `INPUT_FILES`, `INPUT_STYLE`, or the contents of linted files (e.g., via a malicious PR), this can enable command injection and/or arbitrary JavaScript execution in the CI/runtime context. No direct exfiltration behavior is visible in the module, but the execution risk is significant.
No overt in-module malicious logic is visible (no obfuscation, no eval/dynamic payload execution, no credential theft/persistence). However, the module performs runtime supply-chain execution by invoking `npx` to run `shadcn@${SHADCN_VERSION}` and instructing it to fetch remote registry content from a URL built from environment variables. If those environment variables or the target endpoints are manipulated, the invoked tooling could fetch and execute untrusted dependencies or generate unexpected files, and failures may leak stdout/stderr details via console logging. Mitigate by restricting/allowlisting registry URLs and pinning/verifying shadcn versions (and by controlling environment variable sources).