🔒 Fix: Reflected XSS in Contact form (CWE-79) - #52
Open
javokhir-sec wants to merge 1 commit into
Open
Conversation
CWE-79: User-supplied POST fields (name, firstname, email, message) were reflected without output encoding, enabling reflected XSS attacks. Fix: Apply htmlspecialchars() with ENT_QUOTES and UTF-8 to all four user-controlled fields before rendering in the template.
Author
|
Hi @299Ko/developers, Just following up on this security fix PR — it's been 2 weeks since submission. This fixes a Reflected XSS (CWE-79) vulnerability in the contact form that could allow attackers to inject malicious scripts. Could someone please review when you have a chance? The fix is minimal and includes input sanitization. Thank you! — Javokhir (@javokhir-sec) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix for Reflected Cross-Site Scripting (CWE-79) in the Contact plugin.
Vulnerability
The Contact form reflects user-supplied POST fields (
name,firstname,email,message) back into the HTML response without output encoding. 299Ko's template engine does not auto-escape{{ }}expressions, allowing arbitrary HTML/JavaScript injection.CVSS 3.1: 6.1 (Medium) —
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:NFix
Applied
htmlspecialchars()withENT_QUOTESandUTF-8to all four user-controlled fields inContactController::home()before rendering in the template.Affected File
plugin/contact/controllers/ContactController.php(lines 26-29)References
🤖 Generated with Claude Code