Skip to content

🔒 Fix: Reflected XSS in Contact form (CWE-79) - #52

Open
javokhir-sec wants to merge 1 commit into
299Ko:masterfrom
javokhir-sec:fix/xss-contact-form
Open

🔒 Fix: Reflected XSS in Contact form (CWE-79)#52
javokhir-sec wants to merge 1 commit into
299Ko:masterfrom
javokhir-sec:fix/xss-contact-form

Conversation

@javokhir-sec

Copy link
Copy Markdown

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:N

Fix

Applied htmlspecialchars() with ENT_QUOTES and UTF-8 to all four user-controlled fields in ContactController::home() before rendering in the template.

Affected File

  • plugin/contact/controllers/ContactController.php (lines 26-29)

References

  • CWE-79: Improper Neutralization of Input During Web Page Generation
  • OWASP: Cross Site Scripting (XSS)

🤖 Generated with Claude Code

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.
@javokhir-sec

Copy link
Copy Markdown
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)

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.

1 participant