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

fix: special chars in subscriptions #271

Merged
merged 1 commit into from
Apr 9, 2024
Merged

fix: special chars in subscriptions #271

merged 1 commit into from
Apr 9, 2024

Conversation

ellite
Copy link
Owner

@ellite ellite commented Apr 9, 2024

No description provided.

@ellite ellite linked an issue Apr 9, 2024 that may be closed by this pull request
@ellite ellite merged commit 2683a7c into main Apr 9, 2024
2 checks passed
@ellite ellite deleted the fix_special_chars branch May 13, 2024 08:24
@ouuan
Copy link

ouuan commented Oct 11, 2024

#105 double-escaped the inputs, which caused #266. This PR removed htmlentities and added htmlspecialchars_decode at the same time, so #105 is effectively gone. Now it's vulnerable to XSS again. Fortunately, the XSS is only a self-XSS, as the injected data can only be retrieved by the same user, so it has very limited impacts.

However, now the HTML escaping in Wallos is in a mess. They are at least bugs if not vulnerabilities. To name a few:

  • subscription/get.php and subscriptions/get.php use htmlspecialchars_decode
  • index.php does not
  • calendar.php uses an extra htmlspecialchars
  • registration.php and adduser.php use an extra htmlentities.

@ouuan
Copy link

ouuan commented Oct 11, 2024

By the way, it's usually better to escape data when displaying them instead of when saving them to the database. Then you won't ever need htmlspecialchars_decode and you can be sure that the data is escaped no matter what is stored in the database.

@ellite
Copy link
Owner Author

ellite commented Oct 11, 2024

Hi @ouuan , thank you for the report.
Can you please give me a string that would trigger the XSS issue? I can't replicate it.
Regards.

@ouuan
Copy link

ouuan commented Oct 11, 2024

Can you please give me a string that would trigger the XSS issue? I can't replicate it.

<img src="" onerror="alert(1)"> or "><img src="" onerror="alert(2)

@ellite
Copy link
Owner Author

ellite commented Oct 11, 2024

Thanks. That one works.

@ellite
Copy link
Owner Author

ellite commented Oct 11, 2024

2.29.2 released with a fix.
But I still need to cleanup a bit.

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.

[BUG] Ampersand (&) in title or description are displayed as &amp;
2 participants