Content Security Policy (CSP) header cannot be parsed successfully

By
Manieendar Mohan
Published on
19 Jun 2022
Vulnerability
Content Security Policy

Content Security Policy (CSP) is one of the essential computer security standards for establishing a proper and secure site. It was introduced to prevent attacks like cross-site scripting (XSS), clickjacking and other code injection attacks. This application is using Cross-Origin Resource Sharing incorrectly. Hence the usage of the Content Security Policy is not supported and will be ignored by the browsers. There are many web-application where Content Security Policy is implemented inside the body tag.

Impact

The impacts of this type of vulnerability include:-

  • Cross-site scripting - Cross-site Scripting (XSS) is a client-side code injection attack where an attacker can execute malicious scripts into a website or web application.
  • clickjacking - Clickjacking is a malicious technique of tricking an end user into clicking on a malicious link.
  • code injection attacks - Code injection is the exploitation of a computer bug which includes processing invalid data.

Mitigation / Precaution

Beagle recommends the following fixes:-

  • Declare Content Security Policy in HTTP headers or with meta tags inside the head element instead of the body.

Written by
Manieendar Mohan
Manieendar Mohan
Cyber Security Lead Engineer
Experience the Beagle Security platform
Unlock one full penetration test and all Advanced plan features free for 10 days