Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SECURITY] Snapshot names not sanitized #15

Closed
thib3113 opened this issue Jul 28, 2023 · 3 comments
Closed

[SECURITY] Snapshot names not sanitized #15

thib3113 opened this issue Jul 28, 2023 · 3 comments
Assignees
Labels

Comments

@thib3113
Copy link

thib3113 commented Jul 28, 2023

It seems that snapshot names are not sanitized .

I test something like :

it('test / test name', () => {
  cy.matchImageSnapshot()
})

and so it create a folder test , and a file test name .

Can you please sanitize file names ? It seems (here) that cypress use the library sanitize-filename . ( or better, use a hash as filename, so less names collision risk . And your are sure there is no strange chars )

also, I'm pretty sure it can destroy a system ... what happen if I name my test with path traversal ? something like : ../../../etc/password .


I tested it . And we can write any files on a developper computer .

( not exactly with the same name I say before ... but I'll not tell it here ... in private if you want )

Please fix this, and create a repository-security-advisory to tell people to update to a safe version

@thib3113 thib3113 changed the title Snapshot names not sanitized [SECURITY] Snapshot names not sanitized Jul 28, 2023
@simonsmith simonsmith self-assigned this Jul 31, 2023
@simonsmith
Copy link
Owner

🎉 This issue has been resolved in version 8.0.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@simonsmith
Copy link
Owner

Thanks for highlighting this one @thib3113, should be fixed now 👌🏻

@thib3113
Copy link
Author

great ! thank you !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants