Back to skill

Security audit

Cypress

Security checks for vulnerabilities and agentic risk

Overview

This Cypress testing skill is mostly ordinary, but some templates contradict its privacy promises by enabling Cypress Cloud recording and optional cross-project home-directory memory.

Review before installing. Remove or explicitly opt into Cypress Cloud recording, do not use production secrets or sensitive data in tests, restrict CI artifact access and retention, pin Cypress and GitHub Actions versions where possible, and avoid creating ~/cypress/memory.md unless you want cross-project testing notes retained outside the repository.

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 (3)

T08 · Insecure Dependencies

Warning
Location
setup.md:22
Finding
Unpinned Cypress Dependency Is Installed and Immediately Executed<![CDATA[ ## Vulnerability Details **File Location**: `setup.md:22-23` **Vulnerability Type**: Supply-chain exposure through unpinned package installation **Risk Level**: Medium ### Vulnerable Code ```bash npm install -D cypress npx cypress open # First run creates folder structure ``` ### Technical Analysis The setup instructions install Cypress without specifying an audited version and then immediately execute its binary through `npx`. Resolution therefore depends on the package version available from the configured npm registry at execution time. npm installation can execute package lifecycle scripts, while `npx cypress open` executes code supplied by the resolved Cypress package and its dependency tree. If a registry account, package release, transitive dependency, or configured registry is compromised, code can run before the user has reviewed the resolved package contents. No malicious package is embedded in this project; the risk arises from mutable dependency resolution and immediate execution. ### Attack Path 1. An attacker compromises a relevant npm package release, transitive dependency, maintainer account, or registry used by the environment. 2. The Agent follows `setup.md` and runs `npm install -D cypress`. 3. npm resolves and installs the mutable package version and dependency graph. 4. Malicious lifecycle code may execute during installation. 5. The subsequent `npx cypress open` command executes the installed package with the permissions of the Agent or user. 6. The compromised code can access files, environment variables, network resources, and project credentials available to that process. ### Impact Assessment Successful exploitation provides arbitrary code execution with the privileges of the user running the setup command. The accessible scope can include: - Project source code and test fixtures - Environment variables and CI credentials - User-readable files outside the project - Network services reachable from the workstation ...[truncated 222 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Pin Cypress to a reviewed exact version: ```bash npm install --save-dev --save-exact cypress@13.6.0 ``` 2. Commit and review `package-lock.json`, then use `npm ci` for reproducible installation. 3. Require explicit user approval before installing or executing third-party packages. 4. Review package provenance, integrity metadata, release history, and transitive dependencies before adoption. 5. Use npm registry allowlisting and lock down `.npmrc` so package resolution cannot silently use an untrusted registry. 6. Run installation and Cypress in a least-privileged container or isolated CI runner without unnecessary secrets. 7. Add dependency scanning and lockfile integrity checks to CI. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
ci.md:60
Finding
Cypress Cloud Upload Is Enabled Despite Claims That Data Remains Local<![CDATA[ ## Vulnerability Details **File Location**: `ci.md:60-68`; contradictory declarations in `SKILL.md:235-248` **Vulnerability Type**: Undisclosed external transmission of test results and metadata **Risk Level**: Medium ### Vulnerable Code The parallel CI template enables Cypress Cloud recording: ```yaml - uses: cypress-io/github-action@v6 with: start: npm start wait-on: 'http://localhost:3000' record: true parallel: true group: 'E2E Tests' env: CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} ``` This conflicts with the Skill's privacy declarations: ```markdown ## External Endpoints This skill does not call external APIs. Cypress runs entirely locally or in your own CI environment. ## Security & Privacy **Data that stays local:** - All test code and fixtures remain in project directory - Cypress runs locally or in your own CI environment **This skill does NOT:** - Send data to external services - Require API keys or authentication - Access files outside project directory **Note:** Cypress Cloud (optional, paid) can receive test results if configured with `CYPRESS_RECORD_KEY`. This skill does not configure or recommend it. ``` ### Technical Analysis Setting `record: true` and supplying `CYPRESS_RECORD_KEY` configures Cypress to record the run using Cypress Cloud. This is an external service interaction and directly contradicts the statements that the Skill does not send data externally and does not configure or recommend Cypress Cloud. Depending on Cypress configuration and run behavior, uploaded information may include test names, execution results, timing information, CI metadata, logs, screenshots, videos, and other test artifacts. These artifacts may contain application data or credentials rendered during tests. The use of GitHub secret interpolation protects the record key from literal inclusion in the workflow, but it does not address the undisclosed exte ...[truncated 1138 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove `record: true` and `CYPRESS_RECORD_KEY` from the default CI template. 2. Place Cloud recording in a clearly labeled optional section that requires explicit informed user consent. 3. Correct `SKILL.md` so its external-endpoint and privacy declarations accurately describe every provided template. 4. Document: - The external service receiving the data - The categories of data that may be uploaded - Applicable retention and access controls - How recording can be disabled 5. Disable screenshots and videos for flows that handle sensitive information, or redact sensitive values before artifact collection. 6. Use a narrowly scoped Cypress record key and restrict secret availability to trusted branches and workflows. 7. Prevent recording for untrusted pull requests and forked contributions. 8. Pin the GitHub Action to a reviewed immutable commit SHA rather than only a mutable major-version tag. ]]>

T09 · Insecure Skill Coding Practices

Note
Location
memory-template.md:5
Finding
Optional Memory Instructions Write Cross-Project State Outside the Declared Project Boundary<![CDATA[ ## Vulnerability Details **File Location**: `memory-template.md:5-7`; contradictory declaration in `SKILL.md:243-246` **Vulnerability Type**: Undisclosed persistent storage outside the project directory **Risk Level**: Low ### Vulnerable Code ```markdown ## Project-Level Memory (Optional) If tracking Cypress patterns across multiple projects, create `~/cypress/memory.md`: ```markdown # Cypress Memory ``` The suggested memory includes project patterns, user preferences, and recurring issues. This conflicts with the following declaration: ```markdown **This skill does NOT:** - Send data to external services - Require API keys or authentication - Access files outside project directory ``` ### Technical Analysis The memory template directs the Agent to create a persistent file beneath the user's home directory. That location is outside the active project and can survive the current task, be shared across unrelated projects, and be consumed during later sessions. The template does not explicitly direct the Agent to store attacker-controlled instructions, so this is not classified as confirmed Agent Memory Poisoning. The verified issue is instead an insecure scope and privacy practice: the persistent behavior contradicts the declared filesystem boundary and lacks consent, permissions, retention, and data-minimization controls. ### Attack Path 1. The Agent determines that cross-project pattern tracking would be useful. 2. It follows `memory-template.md` and creates `~/cypress/memory.md`. 3. Project conventions, user preferences, and issue history are written outside the current repository. 4. The file persists after the project task ends. 5. A later session or project reads or updates the same shared memory. 6. Information from one project can influence or be disclosed in another project context. ### Impact Assessment The write occurs with the current user's filesystem privileges. The immediate scope is the `~/cypress` directory, but the retain ...[truncated 481 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Store optional memory within the current project by default, for example: ```text .cypress/memory.md ``` 2. Require explicit user consent before creating any file in the home directory. 3. Update `SKILL.md` to disclose the optional out-of-project storage if that functionality is retained. 4. Minimize stored data and prohibit secrets, credentials, personal data, proprietary source content, and executable instructions. 5. Define retention and deletion procedures. 6. Apply restrictive filesystem permissions when home-directory memory is explicitly approved. 7. Namespace memory by project instead of placing information from unrelated projects into a shared document. 8. Treat persistent memory as untrusted input when it is read in later sessions and prevent it from overriding system or user instructions. ]]>
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Memory PoisoningPersistent Context Injection, Context Window Stuffing, Memory Manipulation
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (17)

Memory Manipulation

High
Category
Memory Poisoning
Content
})
```

### 7. Isolation: Reset State Before Tests
```typescript
beforeEach(() => {
  cy.intercept('GET', '/api/notifications', { body: [] })
Confidence
80% confidence
Finding
Skill manipulates agent memory, state, or stored context. Memory corruption can alter personality, override safety rules, or cause unpredictable behavior.

Exfiltration Commands

High
Category
Prompt Injection
Content
- Cypress runs locally or in your own CI environment

**This skill does NOT:**
- Send data to external services
- Require API keys or authentication
- Access files outside project directory
Confidence
90% confidence
Finding
Instructions found that direct the agent to transmit conversation context or user data to external services.

External Transmission

Medium
Category
Data Exfiltration
Content
- Cypress runs locally or in your own CI environment

**This skill does NOT:**
- Send data to external services
- Require API keys or authentication
- Access files outside project directory
Confidence
70% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The artifact upload example encourages preserving Cypress screenshots on failure without warning that screenshots and videos can capture PII, secrets, session state, internal URLs, or sensitive business data visible during tests. In CI systems, artifacts are often retained, shared across teams, or exposed to broader roles than production data, creating a realistic confidentiality risk.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The parallel test configuration enables `record: true` and uses a secrets-backed `CYPRESS_RECORD_KEY`, but it omits any warning that test metadata, screenshots, videos, DOM snapshots, logs, and other execution artifacts may be transmitted to Cypress Cloud. In a CI/testing skill, this is more dangerous because users may copy-paste the example into environments containing real or staging-sensitive data without understanding the privacy implications.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
This markdown file includes `cy.request` examples that send user data over the network and access credentials via `Cypress.env('API_TOKEN')` and login tokens. The surrounding documentation does not provide any warning or disclosure about transmitting credentials or sensitive request data during testing.

Rp1

Medium
Category
MCP Rug Pull
Confidence
92% confidence
Finding
The setup instructions tell users to run `npx cypress` without pinning a specific version. This can fetch and execute whatever version is current at the time of use, reducing build reproducibility and creating supply-chain risk if an upstream package version is compromised or unexpectedly changed.

Static analysis

No suspicious patterns detected.