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

Clientside output purifying #110

Merged
merged 3 commits into from
Jan 6, 2025
Merged

Clientside output purifying #110

merged 3 commits into from
Jan 6, 2025

Conversation

xHeaven
Copy link
Contributor

@xHeaven xHeaven commented Jan 2, 2025

Purify the output on the client via DOMPurify instead of using htmlentities() on the backend.
Kinda reverts #107.

This makes it so we can use colored outputs - therefore keeps the style of dump(), which is fine in my opinion -, but it removes stuff like <script>alert(0)</script> from the output, fixing the possibility of XSS attacks.

See the comparison:

Old method:
image

New method:
image

@freekmurze freekmurze merged commit fc3ba62 into spatie:main Jan 6, 2025
@freekmurze
Copy link
Member

Thanks!

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

Successfully merging this pull request may close these issues.

2 participants