Back to skill

Security audit

Ainative React Sdk

Security checks for vulnerabilities and agentic risk

Overview

The skill is coherent React SDK documentation, but it teaches developers to put an AINative API key in browser-delivered React configuration without adequate safeguards.

Review this skill before installing. Do not put a real AINative API key in React source, Vite variables, CRA variables, or any browser-delivered config; use a backend or short-lived scoped client tokens where possible, and disclose/minimize chat and account data sent to the service. Pin and verify the npm package version before use.

Vulnerability Patterns
  • 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
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:25
Finding

Client-Side API Key Exposure in React Configuration

Content
View full analysis
``` ```bash REACT_APP_AINATIVE_API_KEY=ak_your_key # CRA VITE_AINATIVE_API_KEY=ak_your_key # Vite ``` ```tsx ``` ### Technical Analysis The Skill recommends supplying an API key directly to a React component, including through Create React App and Vite environment variables. These environment-variable mechanisms perform build-time substitution and do not provide secret storage. Values used by browser-side code are included in the generated JavaScript bundle or exposed through runtime network requests. Consequently, any user who can load the application can inspect its JavaScript, application state, or outbound requests and recover the key. The placeholder itself is not a real credential, but the documented pattern instructs developers to replace it with one and therefore creates an insecure production configuration. The chat service necessarily requires network communication to implement the declared functionality. However, exposing a reusable provider credential to every browser exceeds the minimum privilege necessary if requests can instead be authorized by a trusted backend or short-lived, narrowly scoped client token. ### Attack Path 1. A developer follows the Skill and stores a real API key in `REACT_APP_AINATIVE_API_KEY`, `VITE_AINATIVE_API_KEY`, or directly in the provider configuration. 2. The React application is built and deployed. 3. The build system embeds the key in browser-accessible JavaScript, or the application sends it in observable API requests. 4. An attacker opens the application and inspects the bundle, runtime state, or browser network traffic. 5. The attacker extracts the key and submits indepen ...[truncated 645 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
SKILL.md:11
Finding

Unpinned and Unverified Third-Party npm Dependency

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (2)

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The provider setup instructs developers to place an API key directly in client-side React configuration, which exposes the key to any user through bundled JavaScript, browser devtools, or intercepted network traffic. That can enable unauthorized use of the API, quota theft, billing abuse, and misuse of the application's AI backend under the developer's account.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The documentation demonstrates chat and credit hooks that send user prompts, conversation history, and account-related balance data to an external AI service, but it does not warn developers about that data flow. In a React app context, this omission can cause developers to unknowingly transmit sensitive user content or billing/account metadata without proper disclosure, consent, minimization, or policy review.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.