Jit- announcement icon

Announcing Jit’s AI Agents: Human-directed automation for your most time-consuming AppSec tasks.

Read the blog

In this article

What is CVE-2024-44308 (XSS), and How to Protect From It

Charlie Klein - Director of Product Marketing at Jit
By Charlie Klein

Published May 2, 2025.

What is CVE-2024-44308 (XSS), and How to Protect From It

Cross-site scripting (XSS) vulnerabilities are getting harder to spot and easier to exploit. The latest high-profile vulnerability, CVE-2024-44308, is a case in point: a single overlooked input leads to full script execution. Attackers exploiting it can execute malicious code on affected devices without user interaction.

CVE-2024-44308 isn’t an outlier. In 2024, CISA issued urgent guidance on eliminating XSS vulnerabilities, while MITRE named XSS the #1 most dangerous software weakness of 2024, overtaking CSRF, broken access control, and other long-standing threats. For attackers, XSS offers a direct path to session tokens, user data, and full account takeovers. For defenders, preventing these attacks demands more than just output encoding and CSP headers to break the exploit chain.

What is CVE-2024-44308?

Cross-site scripting vulnerabilities allow attackers to inject malicious scripts into web pages' client side. These scripts execute within the victim's browser. 

CVE-2024-44308 is a high-severity XSS vulnerability that Google’s Threat Analysis Group (TAG) uncovered in November 2024. It impacts JavaScriptCore, a component of Apple’s WebKit rendering engine. WebKit is the browser engine behind Safari and many other applications in the Apple ecosystem. 

Like the high-severity CVE-2023-2033, a zero-day vulnerability in Google Chrome’s V8 JavaScript engine, and many other zero-day threats, CVE-2024-44308 was already being exploited in the wild when discovered. 

the web kit is designed to help you learn how to use it


In simple terms, CVE-2024-44308 allows attackers to run malicious code when users simply visit maliciously crafted websites. The root cause is related to how JavascriptCore improperly manages memory when processing JavaScript code. This memory mishandling allows attackers to inject and execute harmful code payloads remotely. It has been confirmed to affect:

  • macOS: Sequoia 15.1.1

  • iOS: 17.7.2 and 18.1.1

  • iPadOS: 17.7.2 and 18.11

  • Safari: 18.1.1

  • Vision iOS: 2.1.1

The NVD vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H provides some insights on why this security flaw has a CVSS score of 8.8 (high severity). It’s exploitable over networks, requires little technical skill to execute, and needs no special privileges. While some user interaction is required, a successful attack presents a high risk of compromising a system’s confidentiality, integrity, and availability.

How Does CVE-2024-44308 Impact Web Applications?

When a user with a vulnerable device visits one of these maliciously crafted websites, the Javascript code on the page is processed by JavascriptCore. The attacker can then break out of JavaScript’s regular security sandbox and bypass browser security boundaries to cause a host of issues for web applications.

Remote Code Execution Across Domains

Unlike regular XSS attacks that stay within one site (same origin policy), this CVE-2024-44308's memory handling flaw breaks down the walls between websites, letting attackers run code that can reach across multiple sites.

Your web application can become vulnerable when users access them through affected WebKit browsers. Once the user’s browser is compromised, attackers can run malicious JavaScript across any site the user visits, including yours. They bypass the Content Security Policy (CSP) and other client-side protections to read sensitive information and perform unauthorized actions.

a diagram of a network with a red cross in the middle


Credential and Session Theft

When users with vulnerable WebKit browsers visit a malicious site, attackers can also silently reach into other tabs to steal login credentials, authentication cookies, OAuth tokens, and active sessions. This vector is particularly damaging in single sign-on environments where a single compromised token can provide access to multiple services.

Developers who rely on HttpOnly cookies and session management for security may find these protections insufficient against this particular exploit, as it operates at the browser engine level rather than the application level.

Client-Side Storage Compromise

Modern web applications frequently use client-side storage mechanisms like LocalStorage, SessionStorage, and IndexedDB to enable offline functionality. CVE-2024-44308 may allow attackers to breach the isolation between these storage containers across different origins. Developers implementing client-side encryption for stored data have some protection, but unencrypted data becomes highly vulnerable.

Browser Extension Manipulation

Many web applications integrate with or rely on browser extensions for enhanced functionality. The JavaScriptCore vulnerability allows attackers to manipulate or extract data from browser extensions running in the affected WebKit environment. 

This creates additional attack surfaces where malicious websites could leverage the elevated privileges often granted to extensions, accessing privileged APIs or sensitive data the extensions have access to.

How to Protect Against CVE-2024-44308 (XSS)

CVE-2024-44308 is a browser-level vulnerability that undermines the security assumptions on which your applications are built. Many standard security best practices can fail against this threat, especially in isolation. You need a mix of defensive measures that can work together to protect users and sensitive data, even if the browser’s security boundaries are compromised. 

1. Design with Browser Security Boundaries in Mind

Even though CVE-2024-44308 breaches browser security boundaries, strict origin separation offers additional protection as part of a defense-in-depth strategy.

For example, splitting your application across multiple subdomains (like accounts.example.com for authentication and content.example.com for user content) creates separate security contexts that require extra work to compromise:

  • Attackers need to figure out which domains hold valuable data

  • They must create specific exploitation codes for those domains

  • They have to get  past any extra application-level protections you’ve put into place

When implementing cross-origin architecture, handle communication with extreme caution. Carefully validate postMessage calls

if (event.origin !== 'https://trusted-domain.com') return;
and use APIs with strict validation rules (make sure to include this step in your API security checklist). Avoid relaxing CORS restrictions, which could expand your attack surface. 

a black background with a red and white text


Leverage iframe sandboxing using the most restrictive permissions for untrusted or third-party content. A properly configured sandbox attribute

<iframe sandbox="allow-scripts allow-same-origin">
prevents malicious content from accessing parent document resources, performing navigation, or executing dangerous operations. 

2. Deploy Web Application Firewalls (WAFs) with Advanced Rules

Web Application Firewalls sit between your users and web applications to inspect all incoming traffic for malicious patterns. Modern WAFs like Cloudflare, AWS WAF, or Big-IP Advanced WAF understand web protocols and can detect application-layer attacks. WAFs aren't a substitute for patching, but they provide valuable time and protection while users update their software.

When setting up your WAF, create rules that detect suspicious JavaScript patterns. For instance, in CloudFlare, you can create custom rules targeting unusual character sequences, excessive string concatenation, or suspicious Unicode patterns that attackers often use to obfuscate exploits.

You should also enable managed rule sets like AWS WAF’s Core rule set (CRS). These are built for browser protection, and WAF providers regularly update them to address emerging threats like CVE 2024-44308. 

3. Implement Content Security Policy (CSP) Headers

A properly configured Content Security Policy restricts what JavaScript can run and where it can load resources. While CSP can't prevent the initial exploitation of browser engine vulnerabilities, it can significantly limit what attackers can do afterward. Start with a restrictive policy that disallows inline scripts and restricts script sources to your trusted domains. For example:

Content-Security-Policy: default-src 'self'; script-src 'self' https://trusted-cdn.com; object-src 'none';

This is often an iterative process. After reviewing the CSP reporting feature

Content-Security-Policy-Report-Only
, you can make targeted exceptions. However, pay special attention to the
script-src
directive, which directly controls JavaScript execution. For advanced protection, consider adding nonce-based or hash-based CSP. Each script requires a unique cryptographic identifier that changes with every page load. This makes it impossible for attackers to predict what value will be accepted by the browser.

4. Regular Vulnerability Scanning

Vulnerability assessments become more effective when you integrate automated security testing tools into your CI/CD pipeline. 

Jit’s Product Security platform integrates powerful scanners like Semgrep and OSV-Scanner directly into CI/CD workflows. With every code push, your code is tested for injection points. This level of automation creates a proactive and developer-friendly way to identify and mitigate XSS vulnerabilities before deployment. 

a screenshot of a computer screen with a dark background


Complement automated scans with hands-on continuous penetration testing, especially after significant updates. Prioritize areas scanners might miss, such as how your website handles user inputs directly in the browser and how different parts of your site interact through scripts. Also, pay attention to dynamic content generated by Javascript and your use of postMessage handlers. Advanced pen testing tools can help your testers intercept and modify HTTP requests in real-time. 

5. Incorporate Browser Isolation Technologies

Browser isolation creates a barrier between the user's device and the websites they visit.  Remote Browser Isolation (RBI) solutions render web content in a secure, isolated environment and stream only safe visual output to the user. This approach can effectively neutralize the threat of XSS, as the malicious code executes in the isolation environment instead of the user’s device.

For internal enterprise applications, embed isolation capabilities directly into your app using APIs from providers like Cloudflare or Zscaler. For example, you can create policy-based isolation where sensitive document viewing or file uploads automatically trigger isolated browsing contexts. 

This isolation approach typically involves adding JavaScript snippets to your application that interact with the isolation service and handle the transition between regular and isolated browsing modes. Additionally, you can implement just-in-time access management to ensure only authorized users trigger isolation features when accessing sensitive content.

If building public-facing applications, you can recommend browser isolation through deployment guides for enterprise customers. You can also design your application to work effectively within isolated environments by avoiding techniques that might break in isolation contexts, such as certain clipboard operations or WebRTC implementations.

6. Sanitize and Validate User Inputs Comprehensively

Attackers often chain multiple vulnerabilities together, and proper sanitization prevents your application from becoming an attack vector.

an info sheet describing how to use an inquitation


Implement context-aware sanitization using libraries like DOMPurify for HTML content or sanitize-html for Node.js. These libraries intelligently filter content based on context rather than simple string replacement, so attackers can’t rely on encoding tricks or attribute manipulation. 

On the server side, validate all inputs using a strict schema validation library like Zod. Focus on potential JavaScript injection points like JSON, URL parameters, and reflected content.

7. Use Secure Frameworks with Built-In XSS Protection

React, Angular, and Vue have robust built-in XSS protections that automatically escape and sanitize user inputs. They help maintain a strong security posture without manually implementing complex sanitization logic. For example, React automatically escapes values embedded in JSX, and Angular provides template syntax that automatically sanitizes values. 

However, you should still exercise caution and avoid using methods like

dangerouslySetInnerHTML
or bypassing built-in sanitization mechanisms. You should also regularly update your framework and related libraries since many XSS vulnerabilities are discovered and fixed in point releases.

Building Strong XSS Defenses with Jit

Cross-site scripting attacks can exploit vulnerabilities in various parts of a web application, including server responses, client-side scripts, and data storage. In some cases, as with CVE-2024-44308, the browser engine can be targeted.

Because XSS vulnerabilities can manifest in multiple ways, the best way to defend your application is through defense-in-depth. Don’t count on any single security control. Instead, combine various practices to make it harder for XSS attackers to succeed. 

Jit provides the edge you need to protect your application from code-based XSS vulnerabilities early in development. You can more easily identify, fix, and manage vulnerabilities directly in your workflows. Incorporating tools such as Semgrep and OSV-Scanner, Jit enables continuous monitoring for potential injection points and known CVEs.

Ready to protect your code from critical vulnerabilities like CVE-2024-44308? Explore more here.