GIVE YOUR AGENT THE EVIDENCE

Set up in your agent.

One prompt to get started. Paste it into your coding agent to connect cve.new through MCP and bring vulnerability context into your workflow.

Your agent needs remote MCP support and access to https://cve.new/mcp.

Read the setup guide

GIVE YOUR AGENT THE EVIDENCE

Investigate in your agent.

Turn this advisory into a focused investigation. Ask your agent to check your project’s versions, explain the evidence, and suggest a compatible fix.

Your agent needs remote MCP support and access to https://cve.new/mcp.

Read the setup guide

All vulnerabilities
GHSA-98gw-w575-h2phmedium5.4

phpMyFAQ is Vulnerable to Stored XSS via Unsanitized Email Field in Admin FAQ Editor

Check your stack

The advisory, in context

Summary

An unauthenticated attacker can submit a guest FAQ with an email address that is syntactically valid per RFC 5321 (quoted local part) yet contains raw HTML — for example "<script>alert(1)</script>"@evil.com. PHP's FILTER_VALIDATE_EMAIL accepts this email as valid. The email is stored in the database without HTML sanitization and later rendered in the admin FAQ editor template using Twig's |raw filter, which bypasses auto-escaping entirely.

Details

  1. PHP FILTER_VALIDATE_EMAIL accepts RFC-valid quoted local parts with dangerous characters

phpmyfaq/src/phpMyFAQ/Controller/Frontend/Api/FaqController.php:99 $email = trim((string) Filter::filterVar($data->email, FILTER_VALIDATE_EMAIL)); PHP accepts "<script>alert(1)</script>"@evil.com as a valid email (RFC 5321 allows <, > inside quoted local parts). Confirmed: "<script>alert(1)</script>"@evil.com => string (valid, not false)

  1. Email stored raw without HTML sanitization

phpmyfaq/src/phpMyFAQ/Faq.php — email retrieved directly as $row->email from the database.

  1. Admin Twig template renders email with |raw

phpmyfaq/assets/templates/admin/content/faq.editor.twig:296 <input type="email" name="email" id="email" value="{{ faqData['email'] | raw }}" class="form-control">

Affected version: 4.2.0-alpha, commit f0dc86c8f

PoC

The reproduction of the vulnerability was implemented with the help of AI while reviewing the source code to generate the proof-of-concept. Please kindly note this for reference. Since the vulnerability has already been confirmed directly in the source code, the proof-of-concept code may be considered as a reference only.

Please extract the attached compressed file and proceed. poc.zip

  1. (docker compose -f docker-compose.yml down -v)
  2. docker compose -f docker-compose.yml up -d mariadb php-fpm nginx
  3. bash exploit.sh

  1. Access http://localhost:8888/admin/
  2. Log in with admin / Admin1234!
  3. After logging in, check whether the URL remains http://localhost:8888/admin/
  4. Go to Content → FAQ Administration → edit "poc" → alert popup should appear If it does not appear, you can also access it directly via: http://localhost:8888/admin/faq/edit/1/en

<img width="1388" height="239" alt="스크린샷 2026-03-12 오후 11 42 52" src="https://github.com/user-attachments/assets/b6d5446f-4eba-4cb2-9284-1bca4855142e" /> <img width="1171" height="92" alt="스크린샷 2026-03-12 오후 11 16 17" src="https://github.com/user-attachments/assets/3578e429-7106-4616-92ed-4167816d40f0" />

Impact

When an administrator opens /admin/faq/edit/{id}/{lang} to review the pending FAQ, the injected script executes in the admin's browser context. This allows an attacker to:

  • Steal the administrator's session cookie → full admin account takeover
  • Perform arbitrary admin actions (create users, modify content, change configuration)
  • Pivot to further attacks on the server

The attack chain requires no authentication. By default, records.allowNewFaqsForGuests=true allows unauthenticated FAQ submission, and records.defaultActivation=false guarantees the administrator must visit the edit page to review it.

Note on captcha: The built-in captcha is enabled by default when the PHP gd extension is present (spam.enableCaptchaCode=true). This prevents fully automated exploitation but does not prevent a targeted manual attack — an attacker can solve the captcha once and submit the payload.

Credits

wooseokdotkim

Affected packages

Start with the recorded fix for your release branch. Check your installed version and test compatibility before upgrading. Fixing this advisory does not rule out other vulnerabilities in the release.

Ecosystem versions

Earlier releases before 4.1.1

Fixed in 4.1.1

169 explicitly affected versions

2.10.0-alpha, 2.8.0, 2.8.0-RC, 2.8.0-RC2, 2.8.0-RC3, 2.8.0-RC4, 2.8.0-alpha2, 2.8.0-alpha3, 2.8.0-beta, 2.8.0-beta2, 2.8.0-beta3, 2.8.1, 2.8.10, 2.8.11, 2.8.12, 2.8.13, 2.8.14, 2.8.15, 2.8.16, 2.8.17, 2.8.18, 2.8.19, 2.8.2, 2.8.20, 2.8.21, 2.8.22, 2.8.23, 2.8.24, 2.8.25, 2.8.26, 2.8.27, 2.8.28, 2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.0.5, 4.0.6, 4.0.7, 4.0.8, 4.0.9, 4.1.0, 4.1.0-RC, 4.1.0-RC.2, 4.1.0-RC.4, 4.1.0-RC.5, 4.1.0-RC.6, 4.1.0-RC.7, 4.1.0-alpha, 4.1.0-alpha.2, 4.1.0-alpha.3, 4.1.0-beta, 4.1.0-beta.2

View affected-version evidence
{
  "ranges": [
    {
      "events": [
        {
          "introduced": "0"
        },
        {
          "fixed": "4.1.1"
        }
      ],
      "type": "ECOSYSTEM"
    }
  ],
  "versions": [
    "2.10.0-alpha",
    "2.8.0",
    "2.8.0-RC",
    "2.8.0-RC2",
    "2.8.0-RC3",
    "2.8.0-RC4",
    "2.8.0-alpha2",
    "2.8.0-alpha3",
    "2.8.0-beta",
    "2.8.0-beta2",
    "2.8.0-beta3",
    "2.8.1",
    "2.8.10",
    "2.8.11",
    "2.8.12",
    "2.8.13",
    "2.8.14",
    "2.8.15",
    "2.8.16",
    "2.8.17",
    "2.8.18",
    "2.8.19",
    "2.8.2",
    "2.8.20",
    "2.8.21",
    "2.8.22",
    "2.8.23",
    "2.8.24",
    "2.8.25",
    "2.8.26",
    "2.8.27",
    "2.8.28",
    "2.8.29",
    "2.8.3",
    "2.8.4",
    "2.8.5",
    "2.8.6",
    "2.8.7",
    "2.8.8",
    "2.8.9",
    "2.9.0",
    "2.9.0-alpha",
    "2.9.0-alpha2",
    "2.9.0-alpha3",
    "2.9.0-alpha4",
    "2.9.0-beta",
    "2.9.0-beta2",
    "2.9.0-rc",
    "2.9.0-rc2",
    "2.9.0-rc3",
    "2.9.0-rc4",
    "2.9.1",
    "2.9.10",
    "2.9.11",
    "2.9.12",
    "2.9.13",
    "2.9.2",
    "2.9.3",
    "2.9.4",
    "2.9.5",
    "2.9.6",
    "2.9.7",
    "2.9.8",
    "2.9.9",
    "3.0.0",
    "3.0.0-RC",
    "3.0.0-RC.2",
    "3.0.0-alpha",
    "3.0.0-alpha.2",
    "3.0.0-alpha.3",
    "3.0.0-alpha.4",
    "3.0.0-beta",
    "3.0.0-beta.2",
    "3.0.0-beta.3",
    "3.0.1",
    "3.0.10",
    "3.0.11",
    "3.0.12",
    "3.0.2",
    "3.0.3",
    "3.0.4",
    "3.0.5",
    "3.0.6",
    "3.0.7",
    "3.0.8",
    "3.0.9",
    "3.1.0",
    "3.1.0-RC",
    "3.1.0-alpha",
    "3.1.0-alpha.2",
    "3.1.0-alpha.3",
    "3.1.0-beta",
    "3.1.1",
    "3.1.10",
    "3.1.11",
    "3.1.12",
    "3.1.13",
    "3.1.14",
    "3.1.15",
    "3.1.16",
    "3.1.17",
    "3.1.18",
    "3.1.2",
    "3.1.3",
    "3.1.4",
    "3.1.5",
    "3.1.6",
    "3.1.7",
    "3.1.8",
    "3.1.9",
    "3.2.0",
    "3.2.0-RC",
    "3.2.0-RC.2",
    "3.2.0-RC.4",
    "3.2.0-alpha",
    "3.2.0-beta",
    "3.2.0-beta.2",
    "3.2.1",
    "3.2.10",
    "3.2.2",
    "3.2.3",
    "3.2.4",
    "3.2.5",
    "3.2.6",
    "3.2.7",
    "3.2.8",
    "3.2.9",
    "4.0.0",
    "4.0.0-RC",
    "4.0.0-RC.2",
    "4.0.0-RC.3",
    "4.0.0-RC.4",
    "4.0.0-RC.5",
    "4.0.0-alpha",
    "4.0.0-alpha.2",
    "4.0.0-alpha.3",
    "4.0.0-alpha.4",
    "4.0.0-beta",
    "4.0.0-beta.2",
    "4.0.1",
    "4.0.10",
    "4.0.11",
    "4.0.12",
    "4.0.13",
    "4.0.14",
    "4.0.15",
    "4.0.16",
    "4.0.18",
    "4.0.19",
    "4.0.2",
    "4.0.3",
    "4.0.4",
    "4.0.5",
    "4.0.6",
    "4.0.7",
    "4.0.8",
    "4.0.9",
    "4.1.0",
    "4.1.0-RC",
    "4.1.0-RC.2",
    "4.1.0-RC.4",
    "4.1.0-RC.5",
    "4.1.0-RC.6",
    "4.1.0-RC.7",
    "4.1.0-alpha",
    "4.1.0-alpha.2",
    "4.1.0-alpha.3",
    "4.1.0-beta",
    "4.1.0-beta.2"
  ]
}
Ecosystem versions

Earlier releases before 4.1.1

Fixed in 4.1.1

169 explicitly affected versions

2.10.0-alpha, 2.8.0, 2.8.0-RC, 2.8.0-RC2, 2.8.0-RC3, 2.8.0-RC4, 2.8.0-alpha2, 2.8.0-alpha3, 2.8.0-beta, 2.8.0-beta2, 2.8.0-beta3, 2.8.1, 2.8.10, 2.8.11, 2.8.12, 2.8.13, 2.8.14, 2.8.15, 2.8.16, 2.8.17, 2.8.18, 2.8.19, 2.8.2, 2.8.20, 2.8.21, 2.8.22, 2.8.23, 2.8.24, 2.8.25, 2.8.26, 2.8.27, 2.8.28, 2.8.29, 2.8.3, 2.8.4, 2.8.5, 2.8.6, 2.8.7, 2.8.8, 2.8.9, 2.9.0, 2.9.0-alpha, 2.9.0-alpha2, 2.9.0-alpha3, 2.9.0-alpha4, 2.9.0-beta, 2.9.0-beta2, 2.9.0-rc, 2.9.0-rc2, 2.9.0-rc3, 2.9.0-rc4, 2.9.1, 2.9.10, 2.9.11, 2.9.12, 2.9.13, 2.9.2, 2.9.3, 2.9.4, 2.9.5, 2.9.6, 2.9.7, 2.9.8, 2.9.9, 3.0.0, 3.0.0-RC, 3.0.0-RC.2, 3.0.0-alpha, 3.0.0-alpha.2, 3.0.0-alpha.3, 3.0.0-alpha.4, 3.0.0-beta, 3.0.0-beta.2, 3.0.0-beta.3, 3.0.1, 3.0.10, 3.0.11, 3.0.12, 3.0.2, 3.0.3, 3.0.4, 3.0.5, 3.0.6, 3.0.7, 3.0.8, 3.0.9, 3.1.0, 3.1.0-RC, 3.1.0-alpha, 3.1.0-alpha.2, 3.1.0-alpha.3, 3.1.0-beta, 3.1.1, 3.1.10, 3.1.11, 3.1.12, 3.1.13, 3.1.14, 3.1.15, 3.1.16, 3.1.17, 3.1.18, 3.1.2, 3.1.3, 3.1.4, 3.1.5, 3.1.6, 3.1.7, 3.1.8, 3.1.9, 3.2.0, 3.2.0-RC, 3.2.0-RC.2, 3.2.0-RC.4, 3.2.0-alpha, 3.2.0-beta, 3.2.0-beta.2, 3.2.1, 3.2.10, 3.2.2, 3.2.3, 3.2.4, 3.2.5, 3.2.6, 3.2.7, 3.2.8, 3.2.9, 4.0.0, 4.0.0-RC, 4.0.0-RC.2, 4.0.0-RC.3, 4.0.0-RC.4, 4.0.0-RC.5, 4.0.0-alpha, 4.0.0-alpha.2, 4.0.0-alpha.3, 4.0.0-alpha.4, 4.0.0-beta, 4.0.0-beta.2, 4.0.1, 4.0.10, 4.0.11, 4.0.12, 4.0.13, 4.0.14, 4.0.15, 4.0.16, 4.0.18, 4.0.19, 4.0.2, 4.0.3, 4.0.4, 4.0.5, 4.0.6, 4.0.7, 4.0.8, 4.0.9, 4.1.0, 4.1.0-RC, 4.1.0-RC.2, 4.1.0-RC.4, 4.1.0-RC.5, 4.1.0-RC.6, 4.1.0-RC.7, 4.1.0-alpha, 4.1.0-alpha.2, 4.1.0-alpha.3, 4.1.0-beta, 4.1.0-beta.2

View affected-version evidence
{
  "ranges": [
    {
      "events": [
        {
          "introduced": "0"
        },
        {
          "fixed": "4.1.1"
        }
      ],
      "type": "ECOSYSTEM"
    }
  ],
  "versions": [
    "2.10.0-alpha",
    "2.8.0",
    "2.8.0-RC",
    "2.8.0-RC2",
    "2.8.0-RC3",
    "2.8.0-RC4",
    "2.8.0-alpha2",
    "2.8.0-alpha3",
    "2.8.0-beta",
    "2.8.0-beta2",
    "2.8.0-beta3",
    "2.8.1",
    "2.8.10",
    "2.8.11",
    "2.8.12",
    "2.8.13",
    "2.8.14",
    "2.8.15",
    "2.8.16",
    "2.8.17",
    "2.8.18",
    "2.8.19",
    "2.8.2",
    "2.8.20",
    "2.8.21",
    "2.8.22",
    "2.8.23",
    "2.8.24",
    "2.8.25",
    "2.8.26",
    "2.8.27",
    "2.8.28",
    "2.8.29",
    "2.8.3",
    "2.8.4",
    "2.8.5",
    "2.8.6",
    "2.8.7",
    "2.8.8",
    "2.8.9",
    "2.9.0",
    "2.9.0-alpha",
    "2.9.0-alpha2",
    "2.9.0-alpha3",
    "2.9.0-alpha4",
    "2.9.0-beta",
    "2.9.0-beta2",
    "2.9.0-rc",
    "2.9.0-rc2",
    "2.9.0-rc3",
    "2.9.0-rc4",
    "2.9.1",
    "2.9.10",
    "2.9.11",
    "2.9.12",
    "2.9.13",
    "2.9.2",
    "2.9.3",
    "2.9.4",
    "2.9.5",
    "2.9.6",
    "2.9.7",
    "2.9.8",
    "2.9.9",
    "3.0.0",
    "3.0.0-RC",
    "3.0.0-RC.2",
    "3.0.0-alpha",
    "3.0.0-alpha.2",
    "3.0.0-alpha.3",
    "3.0.0-alpha.4",
    "3.0.0-beta",
    "3.0.0-beta.2",
    "3.0.0-beta.3",
    "3.0.1",
    "3.0.10",
    "3.0.11",
    "3.0.12",
    "3.0.2",
    "3.0.3",
    "3.0.4",
    "3.0.5",
    "3.0.6",
    "3.0.7",
    "3.0.8",
    "3.0.9",
    "3.1.0",
    "3.1.0-RC",
    "3.1.0-alpha",
    "3.1.0-alpha.2",
    "3.1.0-alpha.3",
    "3.1.0-beta",
    "3.1.1",
    "3.1.10",
    "3.1.11",
    "3.1.12",
    "3.1.13",
    "3.1.14",
    "3.1.15",
    "3.1.16",
    "3.1.17",
    "3.1.18",
    "3.1.2",
    "3.1.3",
    "3.1.4",
    "3.1.5",
    "3.1.6",
    "3.1.7",
    "3.1.8",
    "3.1.9",
    "3.2.0",
    "3.2.0-RC",
    "3.2.0-RC.2",
    "3.2.0-RC.4",
    "3.2.0-alpha",
    "3.2.0-beta",
    "3.2.0-beta.2",
    "3.2.1",
    "3.2.10",
    "3.2.2",
    "3.2.3",
    "3.2.4",
    "3.2.5",
    "3.2.6",
    "3.2.7",
    "3.2.8",
    "3.2.9",
    "4.0.0",
    "4.0.0-RC",
    "4.0.0-RC.2",
    "4.0.0-RC.3",
    "4.0.0-RC.4",
    "4.0.0-RC.5",
    "4.0.0-alpha",
    "4.0.0-alpha.2",
    "4.0.0-alpha.3",
    "4.0.0-alpha.4",
    "4.0.0-beta",
    "4.0.0-beta.2",
    "4.0.1",
    "4.0.10",
    "4.0.11",
    "4.0.12",
    "4.0.13",
    "4.0.14",
    "4.0.15",
    "4.0.16",
    "4.0.18",
    "4.0.19",
    "4.0.2",
    "4.0.3",
    "4.0.4",
    "4.0.5",
    "4.0.6",
    "4.0.7",
    "4.0.8",
    "4.0.9",
    "4.1.0",
    "4.1.0-RC",
    "4.1.0-RC.2",
    "4.1.0-RC.4",
    "4.1.0-RC.5",
    "4.1.0-RC.6",
    "4.1.0-RC.7",
    "4.1.0-alpha",
    "4.1.0-alpha.2",
    "4.1.0-alpha.3",
    "4.1.0-beta",
    "4.1.0-beta.2"
  ]
}

References