Questions tagged [content-security-policy]

This tag is for the Content-Security-Policy HTTP header. For policies in companies, use [corporate-policy].

Filter by
Sorted by
Tagged with
0
votes
1answer
104 views

Is it possible to bypass this csp?

Today I created a web application. I'm using this csp to avoid xss attacks. CSP: Content-Security-Policy", `child-src 'none'; connect-src 'none'; default-src 'none'; font-src 'none'; frame-src '...
2
votes
2answers
73 views

Can a Content Security Policy (CSP) enable *new* unsafe behavior?

Does the design and implementation of the content security policy standard allow for the introduction of new unsafe behavior that wasn't there prior to having any CSP at all? For example if my ...
0
votes
3answers
67 views

On what types of web content is a Content-Security-Policy useful?

The W3C spec for Content-Security-Policy or Mozilla CSP docs would be the definitive source for this answer, but it does not seem covered, so I'm asking here for answers based on people's experience. ...
6
votes
2answers
750 views

Content Security Policy https: and data: meaning

I am having trouble finding information on the implications of using https: and data: as a source for the directives in a CSP. Example: img-src 'self' https: data:; Could someone some context around ...
2
votes
3answers
169 views

When is content security policy (CSP) not appropriate?

We've recently conducted a security review of our identity server website and one of the finding was about missing CSP header. We do have implementation of request filter to add CSP on a controller ...
0
votes
0answers
34 views

Vulnerability detection tool that scans for dynamic script tag appending to DOM

I understand that dynamically appending a script tag to DOM could lead to XSS attacks if script's URL isn't properly secured and my.remote.domain.com isn't whitelisted as an allowed domain to load and ...
0
votes
1answer
74 views

Example of script-src-attr that is not already handled by script-src-elem

What would be an example of a CSP script-src-elem directive allowing a script to be loaded but a script-src-attr directive preventing a function in that script from being executed? If you don't want ...
0
votes
1answer
64 views

Validity of a WAF as a Compensating/Alternative Control for CSP, X-XSS-Protection, etc [closed]

I would like to know peoples' thoughts as to whether a WAF is a perfectly acceptable compensating/alternative control to things like CSP, X-XSS-Protection, etc. I know WAF is suppose to protect ...
1
vote
2answers
93 views

Noob question on security of localhost

This may already have been answered, but I'm having difficulty understanding the technical jargon of various posts. I have to give a Callback URL to receive some sort of validation, to use an API. ...
1
vote
0answers
73 views

Prevent XSS in 3rd party (self hosted) application

We have an application which have purchased from a 3rd party and host in our own environment. The application consists of its own UI and back-end, and is included in our own application through an ...
0
votes
2answers
102 views

Content Security Policy [closed]

I'm trying to implement CSP on my site and after some research I saw that most of the sites don't implement it or the implementation is very weak. I also see that the implementation of the CSP is ...
0
votes
1answer
53 views

image blocked by CSP policy even though the image is never requested

The following CSP directive violation is reported: [csp-report] ( [document-uri] => https://mysite.com/my-page/ [referrer] => https://www.google.com/ [violated-...
0
votes
1answer
50 views

Is using a server as bridge secure enough to protect the end data?

It comes to my mind a security problem that I would have accessing some data. My current problem is the following: There is a server in AWS London where you can access some data, by law, that data ...
0
votes
2answers
98 views

Does an effective Content Security Policy mitigate a universal cross-site scripting vulnerability?

I am doing some background research into types of XSS and prevention and as I understand it there is not much any application can do against a universal XSS in a plugin or browser. A last line of ...
0
votes
0answers
31 views

Content from external sources still visible after applying CSP

I've added CSP layer of security in my application. Now in chrome's web inspector, I can see CSP header in every web service response: Content-Security-Policy: default-src 'self' *.intranet.myhost.com ...
1
vote
0answers
66 views

chrome-extension as source of CSP policy violation

Here is an extract from a CSP report [csp-report] => Array ( [blocked-uri] => chrome-extension [column-number] => 27329 [document-uri] => https://www.mysite.com/...
2
votes
2answers
382 views

Why only script-src unsafe-inline is reported as a high severity finding?

I'm evaluating a CSP policy using https://csp-evaluator.withgoogle.com/. The policy is configured as follow: default-src 'self';object-src 'self';script-src 'self' 'unsafe-inline' 'unsafe-eval';script-...
0
votes
1answer
226 views

CSP allowing Base64 encoded images without unsafe-eval

If I allow base64 encoded images to load on my website, but I do not have unsafe-eval enabled, nor have I allowed 'inline-script' would my site still be at risk by allowing base64 encoded image data ...
1
vote
0answers
64 views

Safely render HTML template with inline CSS from trusted domain (it forces the use of “style-src: unsafe-inline” in CSP)

I am working with a form that a user can fill out to send an e-mail. As part of the form, there is a preview button that shows the user a preview of how the mail will look in a new tab in the browser. ...
2
votes
2answers
111 views

Reverse tabnabbing: why not redirect the user in the new tab itself instead of the parent tab?

I have recently been reading about reverse tabnabbing, where a child window can change the url of the parent window if it has access to window.opener (which it has by default unless you explicitly ...
2
votes
2answers
387 views

What is the behaviour of CSP if default-src not specified?

Basically all in the title. Imagine a simple CSP like Content-Security-Policy: script-src 'self' What is the behaviour of directives that would normally fall back to default-src which are not ...
1
vote
1answer
96 views

Is it possible to bypass malformed Content Security Policy missing quotes?

I found a website that has a very strict but malformed Content Security Policy of the form: Content-Security-Policy: script-src none which should actually be Content-Security-Policy: script-src 'none'...
0
votes
2answers
162 views

Does CSP mitigate against client prototype pollution XSS and DOM XSS?

DOM XSS and client prototype pollution-based XSS have one thing in common, we are modifying the pre-existing JavaScript code to popup an alert(1). Will CSP mitigate XSS in this case? Theoretically, ...
2
votes
1answer
97 views

Content-Secure-Policy headers

I am performing a security assessment on a web application and I found it doesn't have the Content-Security-Policy, but instead it has Content-Secure-Policy. It is literally the first time I'm seeing ...
0
votes
2answers
319 views

What do I risk if I use CSP header style-src-attr 'unsafe-hashes' <hash>

I'm wondering if I'm risking anything if I use style-src-attr 'unsafe-hashes' <hash> in my CSP header. I need to allow an external script to run, and it uses the style attribute on some ...
0
votes
1answer
72 views

Save encrypted data in server . With no way for server to read actual data

Hello i am developing an app that collects some private data from my clients. My clients wont like it if i am able to read the data. So the data is encrypted in cleint side with a key say "xyz&...
0
votes
1answer
67 views

Is https://div.show/options fraud/malware? [closed]

Is https://div.show/options fraud/malware? I saw via https://app.uriports.com that a customer tried to load the page mentioned before and it was blocked thanks to CSP.
0
votes
0answers
296 views

Which security headers should be sent with static files such as css/js/images

Of the security headers listed here: https://owasp.org/www-project-secure-headers/ which ones should be sent with static files (css, js, images etc) and what does setting them each achieve in that ...
1
vote
0answers
271 views

Do object-src and base-uri bypasses still work on Content-Security-Policies?

I'm assessing the security level of a webapp and one of the test cases is the CSP header. I always use the Google CSP evaluator to assess the header. Let's consider the following CSP header: Content-...
2
votes
0answers
147 views

Understanding CSP: report shows blocked <script> that shouldn't have been blocked

I'm having trouble making sense of some reported CSP violations that don't seem to actually be violations according to the CSP standard. I have not managed to reproduce the violations in my own ...
1
vote
1answer
85 views

Is nonce useless when user input is reflected within an inline script?

I stumbled upon a web app which is accepting user input and putting it into a variable within script tag. The script tag does have a nonce attribute. As am working on bypassing the XSS filter, I had ...
3
votes
2answers
64 views

Serving “less trusted” content on the same domain

Let's say we run a web app at "example.org". It uses cookies for user authentication. Our website also has a blog at "example.org/blog", hosted by a third party. Our load ...
0
votes
0answers
154 views

CSRF token not sent when calling the back-end?

My system composes of NuxtJs and AdonisJs application. Adonis handles csrf tokens for us by sending: set-cookie: adonis-session=XXX; Path=/; HttpOnly set-cookie: XSRF-TOKEN=XXX; Max-Age=7200; Path=/; ...
1
vote
1answer
160 views

CSP Violation ms-appx-web://

We have a java application which allows users to upload attachments and save it on the server. The application has a content security policy defined like this: base-uri 'self'; child-src 'self'; form-...
1
vote
1answer
352 views

3D secure 2 and CSP

I'm building a checkout page for a website and have a checkout page with a content security policy (CSP). When the customer pays with a card, they will see a box popup with the bank page that allows ...
0
votes
1answer
61 views

Error on Content Security Policy while testing for Clickjacking

I was recently testing for Clickjacking and when I opened developer tools, I was warning Content Security Policy: Ignoring “'unsafe-inline'” within script-src or style-src: nonce-source or hash-source ...
1
vote
1answer
216 views

Enabling HTTP Security headers in S/4 Hana web applications

We have 3-4 S/4 HANA applications in our environment and want to enable HTTP Security Headers, but couldn't figure out how to go about it. We then approached SAP directly and even their solutions are ...
0
votes
1answer
56 views

Content-Security-Policy (CSP) HTTP Header useful for direct link to image?

Is there any reason to show a Content-Security-Policy (CSP) HTTP Header for direct links to images such as https://invalid.tld/direct-link-to-image.jpeg?
3
votes
4answers
2k views

Content Security Policy applied to Single Page Applications: Is it worth it with unsafe-inline?

I have a website developed using VueJS (i.e. its a single page application). I've been looking at implementing Content Security Policy headers. As I tested out the header values I would need, I ...
0
votes
0answers
35 views

Is there a way to limit cookies to certain hosts in HTTP?

Using Nginx, I hope to restrict the permissible hosts for cookies. My initial intention was to employ a Content Security Policy for this purpose, but I don't see an obvious way to do this via a CSP. ...
2
votes
1answer
255 views

CSP is not enforced inside Web Worker

A CSP response header is set on the web worker JS file, but it is not enforced by the browser. The CSP is enforced in the Web worker only if the parent document's response header contains the CSP ...
1
vote
1answer
48 views

Is there any way for a Content-Security-Policy to block a CSS function, (specifically the url() function)?

I would like to block the execution of any instance of CSS's url() function in CSS provided by my server. One promising method would be a CSP, but I'm not sure if this is possible using a CSP. Is it? ...
0
votes
0answers
273 views

CSP: any way to prevent inline scripts dynamically created by a trusted external script?

Let's say I have a simple web application which uses a single JavaScript (JS) file, loaded from its own domain, and has implemented the restrictive Content Security Policy (CSP) of default-src 'self'. ...
0
votes
1answer
82 views

Security headers in application vs. Tomcat default 40x error

I would like to assess the actual risk for various CORS attacks when a web application properly sets CSP and other response headers, but the app server error page does not. When a 40x can be provoked ...
0
votes
1answer
620 views

WYSIWYG Rich text editor and renderer with no XSS risks

In our web app, we need to allow users to input rich text which is then presented to other users. We are looking for a simple WYSIWYG (JavaScript) editor that outputs a format which is backwards ...
0
votes
0answers
104 views

Why CSP vs XSS?

I understand CSP can be beneficial against multiple attack vectors (i.e clickjacking, XSS), but as it specifically relates to XSS -- why is it a solution? My reason for asking this question stems ...
1
vote
1answer
182 views

Best Firewall Zone Settings for Security Gli-net Routers

I believe many will benefit from this as there is not clear answer online and I keep making my policies too strong and locking myself out from accessing the LAN admin panel. What would be the ...
2
votes
2answers
1k views

NONCE not supported in Asp.Net for CSP implementation

Is NONCE supported in Asp.Net when implementing Content-Security-Policy header to protect from XSS ?? I read that NONCE was not supported in Asp.Net, however I read another simple article, that shows ...
3
votes
1answer
365 views

Why is CSP require-sri-for marked as obsolete?

The description from Mozilla warns that require-sri-for is obsolete and may be removed at any time. The feature seems useful, especially for large websites where it's likely that a developer may ...
5
votes
1answer
1k views

What was the real reason for dropping reflected-xss directive from CSP?

There were two response headers which could be set by servers to instruct browsers to enable heuristics based reflected XSS detection and prevention in the past. X-XSS Protection: 1; mode=block ...