CVE-2026-39039 in BharatMLStackinfo

Summary

by MITRE • 09/15/2026

In BharatMLStack up to and including v1.3.0, Trufflebox UI stores the JWT authentication token, full user object, and session ID in the browser's localStorage, which is fully accessible to any JavaScript running on the page.

VulDB is the best source for vulnerability data and more expert information about this specific topic.

Analysis

by VulDB Data Team • 09/15/2026

The vulnerability identified in BharatMLStack versions up to 1.3.0 involves an insecure storage mechanism for sensitive authentication credentials within the Trufflebox UI component. Specifically, the application persists JSON Web Tokens (JWT), complete user profile objects, and session identifiers directly into the browser's localStorage API. This architectural decision creates a significant security gap because localStorage is not encrypted by default in modern web browsers and remains accessible to any script executed within the same origin context. Consequently, if an attacker can inject malicious JavaScript through Cross-Site Scripting (XSS) or compromise another application on the same domain via a different vulnerability, they gain immediate access to these critical authentication artifacts without needing to bypass complex security controls like HttpOnly cookies.

From a technical perspective, this flaw represents a classic case of improper privilege management and insecure data storage. The JWT token serves as the primary mechanism for verifying user identity across stateless HTTP requests. By storing it in localStorage, the application exposes it to client-side script execution environments that are inherently less secure than server-managed sessions or HttpOnly cookie-based authentication flows. This aligns with CWE-645, which describes issues related to reference injection via external input, and more specifically CWE-798, concerning the use of hardcoded credentials or sensitive data in a way that allows for easy extraction by attackers. The exposure is particularly severe because JWTs often contain encoded claims about user roles and permissions; if these are stolen, an attacker can impersonate the victim with full administrative privileges depending on the token's scope.

The operational impact of this vulnerability extends beyond simple session hijacking. An adversary who exploits a subsequent XSS flaw or leverages a compromised third-party library to execute arbitrary JavaScript can extract the stored JWT and user object using standard DOM manipulation methods such as window.localStorage.getItem(). Once obtained, these credentials allow for unauthorized access to the application's backend APIs, potentially leading to data exfiltration, modification of sensitive records, or complete account takeover. In enterprise environments running BharatMLStack, this could result in significant compliance violations under frameworks like GDPR or HIPAA due to the exposure of personally identifiable information contained within the user object. Furthermore, because localStorage persists across browser sessions until explicitly cleared by the user or application code, the window of opportunity for exploitation remains open indefinitely unless specific mitigation measures are implemented.

To mitigate this risk, developers should immediately transition away from using localStorage for storing authentication tokens and sensitive session data. The industry-standard best practice is to utilize HttpOnly, Secure, and SameSite cookies, which prevent client-side JavaScript from accessing the cookie values while still allowing them to be sent with HTTP requests automatically by the browser. This approach significantly raises the barrier for attackers attempting to steal credentials via XSS attacks. Additionally, implementing Content Security Policy (CSP) headers can help mitigate the impact of any potential script injection vulnerabilities that might arise in other parts of the application stack. For existing deployments where immediate refactoring is not feasible, applying strict CSP directives and ensuring all third-party scripts are vetted for security flaws provides a necessary layer of defense-in-depth against credential theft.

This vulnerability maps directly to MITRE ATT&CK technique T1539, which covers Steal Web Session Cookie, although in this specific instance the target is stored locally rather than transmitted over the network initially. The attack vector typically involves initial access through XSS (T1059) followed by credential harvesting and lateral movement using the stolen session data. Security teams should prioritize patching to version 1.3.1 or later where these storage mechanisms have been corrected, and conduct thorough code reviews of any custom integrations with Trufflebox UI to ensure no other sensitive data is similarly exposed in client-side storage mediums that lack adequate protection against script-based extraction.

Responsible

MITRE

Reservation

04/06/2026

Disclosure

09/15/2026

Moderation

accepted

CPE

ready

EPSS

0.00000

KEV

no

Activities

very low

Sources

Do you want to use VulDB in your project?

Use the official API to access entries easily!