Loading HuntDB...

GHSA-vxjg-hchx-cc4g

GitHub Security Advisory

@simonsmith/cypress-image-snapshothas fix for insecure snapshot file names

✓ GitHub Reviewed MODERATE Has CVE

Advisory Details

### Impact
It's possible for a user to pass a relative file path for the snapshot name and reach outside of the project directory into the machine running the test. Example:

```js
cy.get('h1').matchImageSnapshot('../../../ignore-relative-dirs')
```
The above will create an `ignore-relative-dirs.png` three levels up

### Patches
Fixed in `8.0.2`

### Workarounds
Validate all the existing uses of `matchImageSnapshot` to ensure correct use of the filename argument. Example:

```js
// snapshot name will be the test title
cy.matchImageSnapshot();

// snapshot name will be the name passed in
cy.matchImageSnapshot('login');
```

### References
https://github.com/simonsmith/cypress-image-snapshot/issues/15

Affected Packages

npm @simonsmith/cypress-image-snapshot
Affected versions: 0 (fixed in 8.0.2)

Related CVEs

Key Information

GHSA ID
GHSA-vxjg-hchx-cc4g
Published
August 1, 2023 4:59 PM
Last Modified
August 4, 2023 6:41 PM
CVSS Score
5.0 /10
Primary Ecosystem
npm
Primary Package
@simonsmith/cypress-image-snapshot
GitHub Reviewed
✓ Yes

Dataset

Last updated: July 30, 2025 6:36 AM

Data from GitHub Advisory Database. This information is provided for research and educational purposes.