Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-107303 Overview
CVE-2026-107303 is a stored cross-site scripting (XSS) vulnerability affecting applications generated by JHipster prior to generator-jhipster 9.4.0 and react-jhipster 1.1.0. Generated applications persist attacker-controlled Blob data along with its companion ContentType value, return both through generated REST endpoints, and pass them to the openFile helper in data-utils.ts.ejs. The helper uses the stored ContentType as the browser Blob MIME type and opens an object URL, allowing active HTML or SVG content to execute under the application origin. The flaw is tracked under [CWE-79].
Critical Impact
An authenticated user with write access to a Blob-bearing entity can store active HTML or SVG content that executes in a privileged user's browser session, enabling account takeover of higher-privileged users.
Affected Products
- JHipster generator-jhipster prior to 9.4.0
- react-jhipster prior to 1.1.0
- Applications generated with the affected JHipster versions that include Blob-bearing entities
Discovery Timeline
- 2026-10-08 - CVE-2026-107303 published to NVD
- 2026-10-09 - Last updated in NVD database
Technical Details for CVE-2026-107303
Vulnerability Analysis
JHipster scaffolds REST endpoints and client-side helpers that handle binary fields (Blobs) and their associated ContentType metadata. In the generated Angular and React templates, the openFile helper constructs a browser Blob using the server-returned ContentType string as the MIME type, then opens an object URL for the resulting Blob.
When an authenticated user with write access stores HTML or SVG content and labels it with a scriptable MIME type such as text/html or image/svg+xml, the generated client renders the content with that MIME type when a privileged viewer opens the file. The resulting document executes JavaScript under the application origin, giving the attacker access to the victim's session, cookies accessible via DOM, and application APIs.
Root Cause
The generated openFile helper located at generators/client/generators/common/templates/src/main/webapp/app/shared/jhipster/data-utils.ts.ejs trusts the persisted ContentType field without allow-listing safe MIME types or forcing a download disposition. Combined with permissive REST endpoints that return the user-supplied ContentType, the design enables stored XSS whenever Content Security Policy (CSP) does not block Blob-origin script execution.
Attack Vector
Exploitation requires an authenticated account with write permission to an entity that stores Blob data. The attacker uploads a payload with HTML or SVG content and sets the ContentType to a scriptable value. When a privileged user later opens the file through the generated UI, the browser renders the Blob with the attacker-controlled MIME type and executes embedded script in the application origin.
// Patch excerpt — Angular detail template now constrains openFile to image rendering
<%_ } else if (field.fieldTypeBinary && field.blobContentTypeImage) { _%>
@if (<%- entityInstance %>Ref.<%- fieldName %>) {
<div>
- <a (click)="openFile(<%- entityInstance %>Ref.<%- fieldName %>, <%- entityInstance %>Ref.<%- fieldName %>ContentType)">
+ <a (click)="openFile(<%- entityInstance %>Ref.<%- fieldName %>, <%- entityInstance %>Ref.<%- fieldName %>ContentType, 'image')">
<img [src]="'data:' + <%- entityInstance %>Ref.<%- fieldName %>ContentType + ';base64,' + <%- entityInstance %>Ref.<%- fieldName %>" style="max-width: 100%;" alt="<%- entityInstance %>"/>
</a>
Source: GitHub Commit efe95edd
The fix adds a third argument restricting the Blob type category, so that stored content is opened as a download unless the content type is explicitly on an allow-list of safe media types.
Detection Methods for CVE-2026-107303
Indicators of Compromise
- Database rows in Blob-bearing entity tables where the *ContentType column holds text/html, image/svg+xml, application/xhtml+xml, or other scriptable MIME values
- Uploaded Blob payloads containing <script> tags, inline event handlers, or SVG <foreignObject> elements
- Browser console errors or CSP violation reports referencing blob: origins after a privileged user opens an entity attachment
Detection Strategies
- Audit all Blob-bearing JPA entities and inspect persisted ContentType values against an allow-list of safe MIME types
- Review server access logs for PUT/POST requests to entity endpoints where the request body sets ContentType to a scriptable value
- Scan stored Blob content for HTML, JavaScript, or SVG script constructs using static scanning before serving to clients
Monitoring Recommendations
- Enable and monitor CSP violation reporting to catch Blob-origin script execution attempts in production
- Alert on anomalous reads of Blob entities by privileged accounts shortly after writes by low-privileged users
- Track dependency inventory for generator-jhipster and react-jhipster versions across build pipelines
How to Mitigate CVE-2026-107303
Immediate Actions Required
- Upgrade generator templates to generator-jhipster 9.4.0 and react-jhipster 1.1.0, then regenerate affected client code
- Patch deployed applications by porting the upstream openFile change to force a download for non-image content types
- Restrict write access to Blob-bearing entities to trusted roles until the patch is deployed
- Rotate session tokens for privileged accounts that may have opened user-uploaded Blobs
Patch Information
The fix ships in generator-jhipster 9.4.0 via commit efe95edd4dedc3379735094936439410a51ce3d9 and pull request #34807. The patched openFile helper accepts a BlobType parameter and treats stored Blobs as downloads unless the content type is on an allow-list. See the GitHub Release v9.4.0 and the GitHub Security Advisory GHSA-9ffp-22j7-56r2 for full details.
Workarounds
- Enforce a strict Content Security Policy that disallows script execution from blob: origins (for example, script-src 'self')
- Server-side validate uploaded ContentType values against an allow-list such as image/png, image/jpeg, image/gif, and application/pdf
- Serve Blob downloads with Content-Disposition: attachment and X-Content-Type-Options: nosniff headers to prevent inline rendering
# Upgrade JHipster generator and regenerate client assets
npm install -g generator-jhipster@9.4.0
npm install react-jhipster@1.1.0 --save
# Then regenerate client code in the project root
jhipster --with-entities
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

