Sep 25, 2026·5 min read·18 visits
A stored cross-site scripting vulnerability in code16 Sharp allows authenticated users to inject arbitrary JavaScript via the 'srcdoc' attribute of an 'iframe' in rich-text fields. This bypasses backend sanitization because web browsers decode HTML entities within this attribute before execution.
A stored cross-site scripting (XSS) vulnerability was identified in the content-management and administrative framework code16 Sharp. The flaw stems from an overly permissive HTML sanitization configuration that whitelists the 'srcdoc' attribute on HTML 'iframe' tags. When processed and stored, browsers render the content of this attribute by decoding nested HTML entities, converting sanitized elements back into executable code.
The administrative and content-management framework code16 Sharp for Laravel utilizes a rich-text editor allowing content creators to format and structure HTML. To prevent security issues, the framework employs an HTML sanitizer on incoming submissions before storing them in the persistent database layer.
However, in versions prior to 9.22.5, the backend sanitization rules explicitly allowed the 'srcdoc' attribute on 'iframe' elements. This configuration creates a critical parsing vector due to the structural differences between how server-side libraries sanitize raw HTML and how client-side user agents render the nested documents of iframes.
Because the input is persistently stored, any user with permission to edit a rich-text field can introduce malicious scripts. When another administrative user views the edited content within the Sharp interface, the script executes, creating a significant privilege escalation risk.
The root cause of this vulnerability lies in the improper neutralization of input within nested browser rendering contexts (CWE-79). When a server-side HTML sanitizer processes an iframe with a 'srcdoc' attribute, it attempts to protect the page by HTML-encoding active tag markers inside the attribute. For example, the string <script> becomes <script>.
While this sanitization is sufficient for typical attribute contexts, the 'srcdoc' attribute defines the content of an embedded HTML document. Web browsers natively process this attribute by applying a standard decoding pass. During this pass, the browser converts all HTML entities (such as < and >) back into their literal characters before executing the DOM parser inside the frame.
Consequently, the browser reverses the safety measures applied by the sanitizer. The safe, encoded string is normalized back into an active script block inside the document. The browser then executes the script in the context of the parent domain unless isolated by a strict sandbox configuration.
The configuration error was located within the backend formatting class at src/Utils/Sanitization/FormatsSanitizedValue.php. The sanitizer instances whitelisted several attributes on iframe elements, including the vulnerable 'srcdoc' attribute.
Below is the relevant code before the remediation was applied:
private function sanitizer(): HtmlSanitizer
{
return (new HtmlSanitizer())
// ...
->allowAttribute('srcdoc', 'iframe') // The vulnerable configuration
// ...
}The fix, implemented in commit ec509a22c808a5bd9dfad6a0a85c92ce6f411e21, removes 'srcdoc' from the allowed properties. Below is the patch details:
File: src/Utils/Sanitization/FormatsSanitizedValue.php
@@ -49,7 +49,6 @@ private function sanitizer(): HtmlSanitizer
'referrerpolicy',
'sandbox',
'src',
- 'srcdoc',
'width',
'height',
'id',Additionally, the patch hardens data attributes (specifically 'data-html-content') to ensure they are only preserved if the RAW_HTML option is enabled in the rich-text field's toolbar. This prevents alternative bypass paths using unescaped data tags.
An attacker with authenticated access to edit rich-text fields within the admin panel constructs a payload targeting the nested parsing behavior of the iframe. This payload consists of an iframe tag whose 'srcdoc' attribute contains encoded scripting elements.
<iframe srcdoc="<script>alert('Stored XSS')</script>"></iframe>When the application processes this payload, the backend sanitizer evaluates the input. Because 'srcdoc' is whitelisted, the parser accepts the attribute without stripping it. The application saves the sanitized markup to the database.
Upon retrieval, the application renders the raw iframe within the DOM. The browser processes the 'srcdoc' attribute, decodes the HTML entities, and executes the payload inside the frame, bypassing standard sanitization filters.
A successful attack allows arbitrary JavaScript to execute in the security context of the victim's session. Since code16 Sharp is a Laravel-based administrative and content-management framework, the typical user of this interface holds elevated privileges (e.g., content managers, editors, and administrators).
The executing script can perform actions on behalf of the victim. This includes hijacking active sessions via cookie extraction (unless protected by HttpOnly flags), reading sensitive data exposed in the administrative console, or silently performing state-changing operations such as creating new administrative accounts, modifying application configurations, or deploying malicious templates.
The primary remediation strategy is upgrading the code16/sharp package to version 9.22.5 or higher. This permanently removes 'srcdoc' from the whitelist of the underlying sanitizer.
If upgrading immediately is not possible, a temporary workaround can be achieved via a global Laravel middleware or custom validation rules. This layer should analyze incoming editor fields and remove 'srcdoc' attributes using an XML/HTML DOM parser before storing the content.
public function sanitizeIncomingContent(string $content): string
{
// Temporary regular expression to strip the srcdoc attribute if DOM parsing is unavailable
return preg_replace('/<iframe\b[^>]*\bsrcdoc\s*=\s*(["\'])(.*?)\1/is', '<iframe>', $content);
}For defense-in-depth, configure a Content Security Policy (CSP) header that restricts iframe generation (frame-src 'self') and limits script execution domains to trusted sources.
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:N| Product | Affected Versions | Fixed Version |
|---|---|---|
sharp code16 | < 9.22.5 | 9.22.5 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-79 |
| Attack Vector | Network (N) |
| CVSS Score | 7.3 |
| EPSS Score | 0.0021 |
| EPSS Percentile | 10.08% |
| Exploit Status | poc |
| KEV Status | Not Listed |
CVE-2026-16454 is an object-level authorization bypass vulnerability (CWE-284, CWE-862) in Eclipse hawkBit versions 1.0.3 and prior. The flaw exists within the Direct Device Integration (DDI) REST controller (hawkbit-ddi-resource), where endpoints responsible for enumerating software module metadata and serving firmware binaries fail to verify whether the requested software module is assigned to the authenticated device. Consequently, any device with valid credentials (such as a TargetToken or GatewayToken) can enumerate software module identifiers and download arbitrary firmware artifacts across the entire tenant namespace.
CVE-2026-62284 (GHSA-5w5g-j6hw-6p8f) is a code injection and server-side request forgery vulnerability in the console-proxy component of the OSAC Operator. The RemoteConfigResolver parses Kubernetes Secrets containing kubeconfig files via clientcmd.RESTConfigFromKubeConfig without sanitizing execution-related fields. An attacker with RBAC permissions to create or modify labeled Secrets in monitored namespaces can supply a malicious exec credential plugin, resulting in arbitrary command execution within the console-proxy pod.
CVE-2026-62361 (GHSA-xgjr-7j9q-2h4r) is an authenticated SQL injection and authorization bypass vulnerability in listmonk, an open-source, self-hosted newsletter and mailing list manager written in Go. In versions prior to 6.2.0, the subscriber export endpoint (GET /api/subscribers/export) directly interpolates user-supplied SQL filter expressions into a PostgreSQL query without invoking the table allowlist validation function (validateQueryTables). Consequently, authenticated users possessing the subscribers:sql_query and subscribers:get_all permissions can bypass relational access controls, execute arbitrary subqueries against restricted tables such as users and settings, and modify database state via writable Common Table Expressions (CTEs).
CVE-2026-28385 (GHSA-3gq2-x4qg-p4g6) is a Server-Side Request Forgery (SSRF) vulnerability in Canonical LXD versions 4.12 through 6.9. An authenticated user possessing the can_create_images entitlement can force the LXD daemon to execute arbitrary outbound HTTP and HTTPS requests via the /1.0/images API endpoint. Due to the absence of egress destination validation, an attacker can probe host loopback services, RFC 1918 private network segments, and cloud Instance Metadata Services (IMDS) from the network position of the privileged LXD daemon.
Canonical LXD and LXC Incus contain an arbitrary file write vulnerability (CWE-73 / CWE-59) in the `/1.0/instances/<name>/exec` REST API endpoint. When an instance is unpacked from an image archive, top-level symbolic links are extracted directly onto the host filesystem within the instance storage directory. If a crafted image includes a symbolic link named `exec-output` pointing to an arbitrary host path, invoking the execution endpoint with `record-output: true` causes the privileged host daemon to follow the symlink and write command output files directly to the target host directory. An authenticated attacker with permissions to import images and execute commands can exploit this flaw to write controlled content to sensitive host directories such as `/etc/cron.d`, resulting in arbitrary code execution on the host as `root`.
CVE-2026-48749 (tracked as GHSA-vghh-5rfx-xhq8 for LXD and GHSA-2q3f-q5pq-g8wv for Incus) is a critical container escape vulnerability in the Canonical LXD and Linux Containers Incus system container managers. By importing a specially crafted container image archive containing duplicate tar member headers, an authenticated attacker can replace the instance rootfs directory with a symbolic link pointing to the underlying host root filesystem. When performing file operations on a stopped container, the privileged forkfile helper binary resolves the symbolic link without confinement and chroots directly into the host filesystem, granting arbitrary root-level file read and write access.