Introduction: The Rise of WebRTC Skimming

This week, security researchers reported a concerning new trend: WebRTC skimmers bypassing Content Security Policy (CSP) to steal sensitive payment information from e-commerce websites. This isn't a simple XSS attack; it’s a sophisticated technique leveraging the legitimate functionality of the Web Real-Time Communication (WebRTC) protocol. This new method is particularly alarming because it circumvents a key security measure many organizations rely on to protect against malicious scripts. The implications are significant, potentially exposing customer data and damaging brand reputation. This blog post will break down how this works, why it’s dangerous, and what you can do to protect your organization.

Understanding WebRTC and its Legitimate Use

WebRTC is a powerful technology that enables real-time communication – audio, video, and data – directly between web browsers and servers, without the need for plugins. It’s used for video conferencing (like Google Meet or Zoom), voice calls, and even file sharing. Crucially, WebRTC uses the getUserMedia() API to access a user’s camera and microphone, but also provides access to the user’s network interfaces. This network access, while intended for legitimate peer-to-peer connections, is the key to this new skimming technique.

WebRTC operates using ICE (Interactive Connectivity Establishment) candidates. These candidates represent different ways two peers can connect, including direct connections and relay servers (STUN/TURN servers). The skimmer exploits the ability to send data through these ICE candidates, effectively creating a covert communication channel *outside* the browser’s normal network requests.

How the Skimmer Bypasses CSP

Content Security Policy (CSP) is a browser security mechanism designed to mitigate XSS attacks by controlling the resources the browser is allowed to load. It works by defining a whitelist of trusted sources for scripts, stylesheets, images, and other resources. However, traditional CSP focuses on controlling HTTP(S) requests. The WebRTC skimmer doesn’t make traditional HTTP(S) requests to exfiltrate data; it uses the WebRTC data channel to send stolen information directly to the attacker’s server via the ICE candidates.

Because the data transfer happens through the WebRTC protocol itself, and not through standard web requests, it’s often invisible to CSP. The skimmer injects malicious JavaScript that intercepts form data (credit card numbers, CVV codes, etc.) and then packages this data into WebRTC data packets. These packets are then sent to the attacker’s server, bypassing the CSP’s restrictions.

The Technical Mechanics of the Attack

The attack typically unfolds in these steps:

  • Injection: The malicious script is injected into the e-commerce site, often through a compromised third-party JavaScript library or a vulnerability in the website’s code.
  • Data Interception: The script intercepts user input in payment forms, capturing sensitive data.
  • WebRTC Connection: The script establishes a WebRTC connection to the attacker’s server, using STUN/TURN servers to facilitate communication.
  • Data Exfiltration: The stolen data is packaged into WebRTC data packets and sent to the attacker’s server via the established connection.
  • Data Collection: The attacker’s server receives and stores the stolen payment information.

The skimmer often uses obfuscation techniques to hide its code and evade detection. It may also employ techniques to dynamically generate the attacker’s server address to avoid being blocked by firewalls or intrusion detection systems.

Preventing WebRTC Skimming: A Checklist for IT Administrators

Protecting against this threat requires a multi-layered approach. Here’s a checklist of actionable steps:

  • CSP Hardening: While CSP isn’t a complete solution, strengthening it is crucial. Specifically, restrict the use of ‘unsafe-inline’ and ‘unsafe-eval’ directives. Implement a strict script-src policy, allowing only trusted domains.
  • Subresource Integrity (SRI): Use SRI to verify the integrity of third-party JavaScript libraries. This ensures that the files haven’t been tampered with.
  • Regular Security Audits: Conduct regular security audits and penetration testing to identify vulnerabilities in your website’s code and infrastructure.
  • Third-Party Script Monitoring: Implement monitoring to detect unexpected or malicious behavior from third-party scripts. Tools can help identify scripts making unusual network connections.
  • Web Application Firewall (WAF): Deploy a WAF with rules specifically designed to detect and block WebRTC skimming attempts. Look for WAFs that can inspect WebRTC traffic.
  • Content Security Policy Reporting (CSP Reporting): Enable CSP reporting to receive notifications when CSP blocks occur. This can help you identify potential attacks or misconfigurations.
  • Monitor WebRTC Traffic: Implement network monitoring to detect unusual WebRTC traffic patterns, such as connections to unknown or suspicious servers.
  • Update Libraries: Keep all JavaScript libraries and frameworks up to date to patch known vulnerabilities.
  • Implement Data Loss Prevention (DLP): DLP solutions can help detect and prevent the exfiltration of sensitive data, even through unconventional channels like WebRTC.

Conclusion: Proactive Security is Paramount

The emergence of WebRTC skimming highlights the evolving nature of web security threats. Relying solely on traditional security measures like CSP is no longer sufficient. Organizations must adopt a proactive, multi-layered security approach that includes robust monitoring, regular audits, and advanced threat detection capabilities. Investing in professional IT management and security expertise is essential to stay ahead of these sophisticated attacks and protect your customers’ sensitive data. Ignoring these threats can lead to significant financial losses, reputational damage, and legal liabilities. A strong security posture isn’t just a technical requirement; it’s a business imperative.

Need Expert IT Advice?

Talk to TH247 today about how we can help your small business with professional IT solutions, custom support, and managed infrastructure.