Back to skill

Security audit

React Nextjs Generator

Security checks for vulnerabilities and agentic risk

Overview

This skill is a plausible React/Next.js project generator, but it asks agents to run local scripts and generate files from user-provided text without enough path, dependency, or code-injection safeguards.

Install only if you are comfortable reviewing and sandboxing generated projects. Run it in a disposable workspace, avoid using untrusted requirement documents, verify the invoked script path points to the installed artifact, and review generated files before running npm install or npm run dev.

Vulnerability Patterns
  • Tool Hijacking and SpoofingModifies or replaces tools so legitimate-looking calls execute attacker logic
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
Findings (4)

T09 · Insecure Skill Coding Practices

Error
Location
generator.ts:301
Finding

Arbitrary File Write Through Unsanitized Generated Paths

Content
View full analysis
0) { for (const componentName of requirements.components) { const componentContent = this.generateComponent(componentName, uiAnalysis); await fs.promises.writeFile( path.join(componentsDir, `${componentName}.tsx`), componentContent ); } } ``` ### Technical Analysis Page routes and component names extracted from the user-supplied requirements document are used to construct filesystem paths without validation. Node.js `path.join()` normalizes traversal segments such as `..`; it does not guarantee that the resulting path remains under the intended output directory. The code does not reject absolute paths, traversal components, path separators, symbolic-link escapes, or platform-specific path syntax. Consequently, an attacker who controls the requirements document can cause the generator to write outside `src/app` or `src/components`. This exceeds the minimum filesystem privileges needed to generate a project because the generator should only create files beneath the selected project root. ### Attack Path 1. An attacker supplies a requirements document containing a page route such as `. ...[truncated 1048 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
generator.ts:397
Finding

Generated TypeScript and JSX Code Injection

Content
View full analysis
${page.name} ${page.description} ``` Feature text is also inserted into generated source comments: ```typescript fetchData: async () => { set({ loading: true, error: null }); try { // TODO: Implement fetch logic for ${feature} // const response = await fetch('/api/...'); // const data = await response.json(); // set({ data, loading: false }); } catch (error) { set({ error: error.message, loading: false }); } }, ``` Component text is similarly inserted into TSX: ```typescript private generateComponent(componentName: string, uiAnalysis: any): string { return `\ import React from 'react'; import { Card, Typography } from 'antd'; const { Title, Text } = Typography; interface ${this.toPascalCase(componentName)}Props { // TODO: Define props based on requirements } const ${this.toPascalCase(componentName)}: React.FC<${this.toPascalCase(componentName)}Props> = ({}) => { return ( ${componentName} ``` ### Technical Analysis Values originating in the requirements document are inserted directly into TypeScript and JSX templates. The generator does not appl ...[truncated 1919 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
create-react-app.sh:20
Finding

Execution of Mutable and Unpinned Package Dependencies

Content
View full analysis
Remediation
View remediation

T07 · Tool Hijacking and Spoofing

Warning
Location
OpenClaw-Skill.md:12
Finding

Execution of Scripts from Hard-Coded External Workspace Paths

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (15)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill explicitly instructs the agent to use an execution tool to run a local script and to write user-supplied requirements to a temporary file, but it provides no safety checks, user confirmation, path restrictions, or guidance on handling untrusted input. In a skill that transforms arbitrary user documents into code generation actions, this increases the risk of unintended system modification, unsafe script invocation, or abuse of file and process access.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The entire skill description is written only in Chinese, and there is no indication that users may interact in another language or opt into this locale. Under the policy, language constraints should either be optional for the user or clearly justified as region-specific.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The skill documentation forces a specific language/locale by presenting all user-facing instructions in Chinese, with no indication that users may choose another language. Under the policy, language constraints should be optional or explicitly justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The entire skill content is written only in Chinese and does not indicate that language selection is optional or limited for a justified regional reason. This can violate language or locale policy when a skill implicitly forces a specific language without user opt-in.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill explicitly invokes a local shell script to create a project structure, which will modify the filesystem, but the description does not warn the user about these side effects or ask for confirmation. In an agent setting, undisclosed file-creation behavior can lead to unexpected writes, workspace pollution, or creation of files in unintended locations if the script or context is manipulated.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
91% confidence
Finding

The script executes npx create-next-app@latest, which fetches and runs the latest package version from the network at generation time. Because the version is not pinned to a known-good release, future upstream changes or a compromised package publication could cause unreviewed code execution on the user's machine.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This shell script embeds natural-language and UI locale behavior into generated code by importing zh_CN and setting ConfigProvider locale={zhCN}. Because the skill does not provide an opt-in or explain that the generated project is intentionally China/Chinese-specific, it violates the policy against forcing a specific language/locale without user choice.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

The module comment claims the generator creates a complete project based on requirement documents and UI design images. However, major generation paths such as page components, layout, and stores produce mostly static boilerplate, and the UI analysis is mocked, so the code does not actually do what the documentation claims at an intent level.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This code and the generated UI include fixed Chinese-language descriptions and labels, starting with the class documentation and continuing in generated output. Under the language/locale policy, forcing a specific language without user choice is a natural-language policy violation unless the locale restriction is explicitly justified.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The docstring and inline comments say this method analyzes a UI design image and returns recognized components, layout, and color scheme. In reality, it only logs the path and returns hard-coded data, which directly contradicts the documented behavior rather than merely omitting detail.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The generated page template contains fixed Chinese labels such as "首页", "计数器示例", "增加", and "重置". Because the skill does not provide a language selection mechanism or document a justified locale restriction, it enforces a specific language on generated output.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The layout template inserts fixed Chinese navigation labels including "首页", "产品", and "关于我们". This is a language/locale policy issue because the generated artifact forces a single language and provides no user choice or explicit regional justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The code's comments and console messages are entirely in Chinese, including the usage text and status/error output. This imposes a specific language on users without offering a locale choice or documenting a justified region-specific constraint, which matches the language/locale policy violation criteria.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

This markdown file describes generating a complete React + Next.js project and creating project structure, pages, components, and configuration, but it does not warn the user that files and directories will be created or modified. For a markdown skill description, this is a user-impacting behavior affecting local project data and should be disclosed.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
75% confidence
Finding

The comment at L003 presents the file as a project generator script, but the implementation goes beyond file scaffolding by invoking npx create-next-app@latest and npm install, which download and execute package-defined setup logic from external registries. This is not merely omitted detail about generated files; it materially changes the operational behavior from local generation to remote package retrieval and execution.

Content

No source excerpt is available for this finding.