Cross-Origin Resource Sharing XML cannot be parsed

Published on 19 Jun 2018
Vulnerability
CORS

Cross-Origin Resource Sharing (CORS) is a mechanism that uses additional HTTP header to let the browser know that an application is running from one domain (Origin) and has permission to access resources from another origin (Server). This enables the web browser to perform cross-domain request using XMLHTTPRequest L2 API. This server has XMLHttpRequest API for backward compatibility. This can introduce several security vulnerabilities and fails to validate URLs that are passed to XMLHttpRequest.This will leads to code injection attacks.

Example

Consider a frontend script code for a web application served from http://example.beaglesecurity.com uses XMLHttpRequest to make a request for http://api.example.beaglesecurity.com/data.json.

Impact

The major impact includes code injection attacks. Code injection is the exploitation of a computer bug which includes processing invalid data.

Mitigation / Precaution

Beagle recommends the following:-

  • Allow only selected trusted domains.
Sooraj V Nair
Written by
Cyber Security Engineer

Sooraj was probably the kid who opened up a remote control just to see what was inside, then had to figure out how to put it back together before anyone noticed. That curiosity eventually found its way into cybersecurity, where breaking things is actually part of the job description. Today, he explores vulnerabilities, analysis threats, and helps build safer digital spaces. His favourite question remains the same: “What happens if I try this?”

Experience the Beagle Security platform
Unlock one full penetration test and all Advanced plan features free for 14 days
4.8 on G2 • ISO 27001 certified
See How Beagle Security Works
No credit card • No setup required
Launch interactive demo