Логотип exploitDog
Консоль
Логотип exploitDog

exploitDog

github логотип

GHSA-vxjg-hchx-cc4g

Опубликовано: 01 авг. 2023
Источник: github
Github: Прошло ревью
CVSS3: 6.5

Описание

@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:

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:

// 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

Пакеты

Наименование

@simonsmith/cypress-image-snapshot

npm
Затронутые версииВерсия исправления

<= 8.0.1

8.0.2

EPSS

Процентиль: 53%
0.00296
Низкий

6.5 Medium

CVSS3

Дефекты

CWE-22

Связанные уязвимости

CVSS3: 6.5
nvd
больше 2 лет назад

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.

EPSS

Процентиль: 53%
0.00296
Низкий

6.5 Medium

CVSS3

Дефекты

CWE-22