همهٔ گزارش‌ها
متوسط

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

متن اصلی

نسخه‌های متأثر

نسخه‌های متأثر
<= 8.0.1
نسخهٔ اصلاح‌شده
8.0.2

بهره‌برداری

CVE-2023-38695

احتمال بهره‌برداری در ۳۰ روز آینده: 0.99%

FIRST EPSS · ۱۴۰۵/۰۸/۳۰

شرح آسیب‌پذیری

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

پیوندها

گزارش‌دهندگان

  • thib3113
  • simonsmith