CVE-2023-38695 – @simonsmith/cypress-image-snapshot
Package
Manager: npm
Name: @simonsmith/cypress-image-snapshot
Vulnerable Version: >=0 <8.0.2
Severity
Level: Medium
CVSS v3.1: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N
CVSS v4.0: CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N
EPSS: 0.00296 pctl0.5242
Details
@simonsmith/cypress-image-snapshothas fix for insecure snapshot file names ### 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
Metadata
Created: 2023-08-01T16:59:40Z
Modified: 2023-08-04T18:41:47Z
Source: https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2023/08/GHSA-vxjg-hchx-cc4g/GHSA-vxjg-hchx-cc4g.json
CWE IDs: ["CWE-22"]
Alternative ID: GHSA-vxjg-hchx-cc4g
Finding: F063
Auto approve: 1