CVE-2026-71478
PHP 취약성 분석 및 완화

개요

CVE-2026-71478 is a Cross-Site Scripting (XSS) vulnerability in league/commonmark, a PHP library for parsing and rendering CommonMark Markdown. The vulnerability affects versions >= 1.5.0 and <= 2.8.3, and allows attackers to bypass the AttributesExtension's href/src unsafe-link filter by embedding control bytes (tab, carriage return, line feed, or leading C0 control characters) in javascript: URLs. Browsers discard these control bytes before parsing the URL scheme, causing them to execute the JavaScript even when allow_unsafe_links => false is configured. The vulnerability was reported by TungNGo02, published to the GitHub Advisory Database on August 6, 2026, and carries a CVSS v3.1 base score of 6.1 (Medium) (Github Advisory, Security Advisory).

기술적 세부 사항

The root cause lies in RegexHelper::isLinkPotentiallyUnsafe() in src/Util/RegexHelper.php, which uses an anchored-prefix regex (/^(?:javascript|vbscript|file|data):/i) to detect dangerous URL schemes without first normalizing the input string. Two bypass variants exist: (1) embedding ASCII TAB (0x09), CR (0x0D), or LF (0x0A) within the scheme (e.g., java\tscript:alert(1)), which browsers strip per WHATWG URL Standard step 3; and (2) prepending a leading C0 control character (e.g., \x01javascript:alert(1)), which browsers strip per step 1 of the same algorithm. The AttributesExtension's attribute-value grammar (PARTIAL_DOUBLEQUOTEDVALUE = '"[^"]*"') accepts any byte except " inside quotes, including raw control bytes, and parseAttributes() only trims the default PHP charlist — so a leading \x01 survives into the safety check. Unlike the core Markdown link-destination path (which percent-encodes control bytes before the safety check), the Attributes extension's href/src handling has no equivalent normalization step. The vulnerability is classified as CWE-79 (XSS), CWE-86 (Improper Neutralization of Invalid Characters in Identifiers), and CWE-692 (Incomplete Denylist to XSS) (Security Advisory, Github Advisory).

영향

Successful exploitation enables stored or reflected XSS in applications that render user-supplied Markdown with the AttributesExtension enabled. An attacker can steal session cookies, perform account takeover, execute arbitrary JavaScript in a victim's browser session, and potentially pivot to further attacks within the application's security scope. The scope is marked as "Changed" in the CVSS scoring, reflecting that the impact extends beyond the vulnerable component to the victim's browser context. Availability is not directly impacted, but confidentiality and integrity are both affected at a low level per the CVSS assessment (Github Advisory).

악용 가능성

No public exploit code or in-the-wild exploitation has been reported as of the advisory publication date. The EPSS score is 0.0, indicating very low current exploitation probability, and the vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog. Exploitation requires no privileges and no special configuration beyond the commonly-used AttributesExtension being enabled, but does require user interaction (a victim must click the malicious link). The attack complexity is low, as the bypass technique is straightforward and well-documented in the advisory (Github Advisory, Security Advisory).

착취 단계

  1. Identify a target application: Find a web application that uses league/commonmark versions >= 1.5.0 and <= 2.8.3 with the AttributesExtension enabled and allow_unsafe_links => false configured, and that renders user-supplied Markdown.
  2. Craft the malicious Markdown payload: Construct a Markdown link that uses an unsafe core destination (to prevent LinkRenderer from overwriting the attribute-supplied href) combined with an obfuscated javascript: URL in the attribute block. Example using a literal TAB (0x09) byte:
    [Click me](javascript:alert(0)){href="java\tscript:alert(document.cookie)"}
  3. Submit the payload: Post the crafted Markdown to a location where it will be rendered and viewed by other users (e.g., a comment field, wiki page, or user profile).
  4. Trigger victim execution: When a victim views the rendered page and clicks the link, the browser strips the embedded TAB character from the href value, resolves javascript:alert(document.cookie), and executes the script in the victim's session.
  5. Harvest results: The executed script can exfiltrate session cookies, perform actions on behalf of the victim, or deliver further payloads to the attacker-controlled server (Security Advisory, Github Advisory).

타협의 징후

  • Network: Outbound HTTP requests from victim browsers to attacker-controlled domains immediately after interacting with Markdown-rendered content; requests carrying stolen cookie values in query parameters or POST bodies.
  • Logs: Web server or application logs showing Markdown submissions containing control characters (0x09, 0x0D, 0x0A, 0x01–0x1F) embedded within href or src attribute values in {...} attribute blocks; patterns like java\tscript:, java\nscript:, java\rscript:, or \x01javascript: in stored content.
  • File System: Stored Markdown content in databases or files containing raw control bytes within link attribute syntax (e.g., {href="java[TAB]script:..."}); these may appear as unusual whitespace or non-printable characters in content fields.
  • Application: Unexpected JavaScript execution reports from users; session hijacking events or anomalous authenticated actions following interaction with Markdown-rendered pages (Security Advisory).

완화 및 해결 방법

The fix is available in league/commonmark version 2.9.0, released August 3, 2026. The patch normalizes the URL in RegexHelper::isLinkPotentiallyUnsafe() by stripping ASCII tab/newline characters and left-trimming C0 control characters before applying the unsafe-protocol regex, mirroring the WHATWG URL parser's own normalization. Upgrade via Composer: composer require league/commonmark:^2.9.0. No configuration-based workaround exists for affected versions — even the documented hardening setting (allow_unsafe_links => false) is bypassed by this vulnerability. Applications that cannot upgrade immediately should consider disabling the AttributesExtension entirely or sanitizing user-supplied Markdown with an additional HTML sanitizer before rendering (Security Advisory, Release 2.9.0, Patch Commit).

커뮤니티 반응

The vulnerability was responsibly disclosed by researcher TungNGo02 and acknowledged by maintainer Colin O'Dell (colinodell), who released the fix in version 2.9.0. The advisory notes this is a sibling gap to CVE-2025-46734 (GHSA-3527-qv2q-pfvx), which was fixed in v2.7.0 but did not address control-byte normalization. The 2.9.0 release also addressed five denial-of-service vulnerabilities, with special thanks given to GrahamCampbell and TungNGo02 for responsible disclosure (Release 2.9.0, Security Advisory).

추가 자료


근원이 보고서는 AI를 사용하여 생성되었습니다.

관련 PHP 취약점:

CVE ID

심각도

점수

기술

구성 요소 이름

CISA KEV 익스플로잇

수정 사항이 있습니다.

게시된 날짜

GHSA-wg23-69c2-gjc8CRITICAL9.1
  • PHP logoPHP
  • craftcms/cms
아니요Aug 07, 2026
CVE-2026-71488HIGH7.5
  • PHP logoPHP
  • php-league-commonmark
아니요Aug 06, 2026
CVE-2026-62996MEDIUM6.9
  • PHP logoPHP
  • smarty/smarty
아니요Aug 07, 2026
CVE-2026-62992MEDIUM6.9
  • PHP logoPHP
  • smarty/smarty
아니요Aug 07, 2026
CVE-2026-71478MEDIUM6.1
  • PHP logoPHP
  • league/commonmark
아니요Aug 06, 2026

무료 취약성 평가

클라우드 보안 태세를 벤치마킹합니다

9개의 보안 도메인에서 클라우드 보안 관행을 평가하여 위험 수준을 벤치마킹하고 방어의 허점을 식별합니다.

평가 요청

추가 Wiz 리소스

맞춤형 데모 받기

맞춤형 데모 신청하기

"내가 본 최고의 사용자 경험은 클라우드 워크로드에 대한 완전한 가시성을 제공합니다."
데이비드 에슬릭최고정보책임자(CISO)
"Wiz는 클라우드 환경에서 무슨 일이 일어나고 있는지 볼 수 있는 단일 창을 제공합니다."
아담 플레처최고 보안 책임자(CSO)
"우리는 Wiz가 무언가를 중요한 것으로 식별하면 실제로 중요하다는 것을 알고 있습니다."
그렉 포니아토프스키위협 및 취약성 관리 책임자