Cross-Origin Resource Sharing XML cannot be parsed

By
Sooraj V Nair
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.
Automated human-like penetration testing for your web apps & APIs
Teams using Beagle Security are set up in minutes, embrace release-based CI/CD security testing and save up to 65% with timely remediation of vulnerabilities. Sign up for a free account to see what it can do for you.

Written by
Sooraj V Nair
Sooraj V Nair
Cyber Security Engineer
Experience the Beagle Security platform
Unlock one full penetration test and all Advanced plan features free for 10 days
Find surface-level website security issues in under a minute
Free website security assessment
Experience the power of automated penetration testing & contextual reporting.