{"id":"CVE-2023-38695","aliases":["EUVD-2023-2366","GHSA-vxjg-hchx-cc4g"],"status":"published","title":"cypress-image-snapshot vulnerable to insecure snapshot file names","description":"cypress-image-snapshot shows visual regressions in Cypress with jest-image-snapshot. Prior to version 8.0.2, 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. This issue has been patched in version 8.0.2.","severity":{"version":"3.1","score":6.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N","level":"medium","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-10","score":0.00989,"percentile":0.6279,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-22"],"published":"2023-08-01T16:59:40Z","modified":"2026-10-28T02:30:22Z","fixes":[{"ecosystem":"npm","package":"@simonsmith/cypress-image-snapshot","fixed_in":["8.0.2"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"npm","package":"@simonsmith/cypress-image-snapshot","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"last_affected":"8.0.1"},{"fixed":"8.0.2"}]}]},{"source":"osv","ecosystem":"npm","package":"@simonsmith/cypress-image-snapshot","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"8.0.2"}]}]}],"products":[{"vendor":"simonsmith","product":"cypress-image-snapshot"},{"vendor":"simonsmith","product":"cypress_image_snapshot"}],"references":[{"url":"https://github.com/simonsmith/cypress-image-snapshot/security/advisories/GHSA-vxjg-hchx-cc4g","tags":["x_refsource_CONFIRM","x_transferred","Exploit","Mitigation","Vendor Advisory","advisory","web"]},{"url":"https://github.com/simonsmith/cypress-image-snapshot/issues/15","tags":["x_refsource_MISC","x_transferred","Exploit","Issue Tracking","Patch","Third Party Advisory","report","web"]},{"url":"https://github.com/simonsmith/cypress-image-snapshot/commit/ef49519795daf5183f4fac6f3136e194f20f39f4","tags":["x_refsource_MISC","x_transferred","Patch","fix","web"]},{"url":"https://github.com/simonsmith/cypress-image-snapshot/releases/tag/8.0.2","tags":["x_refsource_MISC","x_transferred","Release Notes","web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2023-38695","tags":["advisory"]},{"url":"https://github.com/advisories/GHSA-vxjg-hchx-cc4g"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/38xxx/CVE-2023-38695.json","tags":["advisory"]},{"url":"https://github.com/simonsmith/cypress-image-snapshot","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2023-38695","title":"cypress-image-snapshot vulnerable to insecure snapshot file names","description":"cypress-image-snapshot shows visual regressions in Cypress with jest-image-snapshot. Prior to version 8.0.2, 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. This issue has been patched in version 8.0.2.\n\n\n","status":"published","published":"2023-08-04T17:25:18.81Z","modified":"2024-10-04T19:39:48.43Z","cvss":[{"version":"3.1","score":6.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N","level":"medium","assessor":"cna"}],"cwes":["CWE-22"],"updated_at":"2026-11-02T14:35:29.772612Z"}],"euvd":[{"id":"EUVD-2023-2366","description":"cypress-image-snapshot shows visual regressions in Cypress with jest-image-snapshot. Prior to version 8.0.2, 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. This issue has been patched in version 8.0.2.\n\n\n","status":"published","published":"2023-08-04T17:25:18Z","modified":"2024-10-04T19:39:48Z","cvss":[{"version":"3.1","score":6.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N","level":"medium"}],"updated_at":"2026-11-03T00:27:49.014643Z"}],"ghsa":[{"id":"GHSA-vxjg-hchx-cc4g","title":"@simonsmith/cypress-image-snapshothas fix for insecure snapshot file names","description":"### Impact\nIt'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:\n\n```js\n  cy.get('h1').matchImageSnapshot('../../../ignore-relative-dirs')\n```\nThe above will create an `ignore-relative-dirs.png` three levels up\n\n### Patches\nFixed in `8.0.2`\n\n### Workarounds\nValidate all the existing uses of `matchImageSnapshot` to ensure correct use of the filename argument. Example:\n\n```js\n    // snapshot name will be the test title\n    cy.matchImageSnapshot();\n\n    // snapshot name will be the name passed in\n    cy.matchImageSnapshot('login');\n```\n\n### References\nhttps://github.com/simonsmith/cypress-image-snapshot/issues/15\n","status":"published","published":"2023-08-01T16:59:40Z","modified":"2023-11-06T05:01:16Z","cvss":[{"version":"3.1","score":6.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N","level":"medium"}],"cwes":["CWE-22"],"updated_at":"2026-11-02T14:37:14.234712Z"}],"nvd":[{"id":"CVE-2023-38695","description":"cypress-image-snapshot shows visual regressions in Cypress with jest-image-snapshot. Prior to version 8.0.2, 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. This issue has been patched in version 8.0.2.\n\n\n","status":"published","published":"2023-08-04T18:15:14.667Z","modified":"2026-06-17T06:10:58.303Z","cvss":[{"version":"3.1","score":6.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N","level":"medium","assessor":"secondary"},{"version":"3.1","score":6.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N","level":"medium","assessor":"primary"}],"cwes":["CWE-22"],"updated_at":"2026-11-02T14:08:20.798312Z"}],"osv":[{"id":"CVE-2023-38695","title":"cypress-image-snapshot vulnerable to insecure snapshot file names","description":"cypress-image-snapshot shows visual regressions in Cypress with jest-image-snapshot. Prior to version 8.0.2, 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. This issue has been patched in version 8.0.2.\n\n\n","status":"published","published":"2023-08-04T17:25:18.81Z","modified":"2026-10-28T02:30:22.066942806Z","cvss":[{"version":"3.1","score":6.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N","level":"medium"}],"cwes":["CWE-22"],"updated_at":"2026-11-02T15:44:32.922049Z"},{"id":"GHSA-vxjg-hchx-cc4g","title":"@simonsmith/cypress-image-snapshothas fix for insecure snapshot file names","description":"### Impact\nIt'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:\n\n```js\n  cy.get('h1').matchImageSnapshot('../../../ignore-relative-dirs')\n```\nThe above will create an `ignore-relative-dirs.png` three levels up\n\n### Patches\nFixed in `8.0.2`\n\n### Workarounds\nValidate all the existing uses of `matchImageSnapshot` to ensure correct use of the filename argument. Example:\n\n```js\n    // snapshot name will be the test title\n    cy.matchImageSnapshot();\n\n    // snapshot name will be the name passed in\n    cy.matchImageSnapshot('login');\n```\n\n### References\nhttps://github.com/simonsmith/cypress-image-snapshot/issues/15\n","status":"published","published":"2023-08-01T16:59:40Z","modified":"2026-09-10T03:49:57.712525841Z","cvss":[{"version":"3.1","score":6.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N","level":"medium"}],"cwes":["CWE-22"],"updated_at":"2026-11-02T15:46:58.04805Z"}]}}
