Content-Security-Policy-Report-Only from app.hubspot.com is reporting errors to browsers

SOLVE
AndrewHo
Member

When embedding a Hubspot form in a website, Chrome is showing the following issues in Devtools:

 

Refused to frame app.hubspot.com because an ancestor violates the following Content Security Policy directive: "frame-ancestors 'self'".

 

I tried several changes to my own site's Content Security Policy however I am sure this is because the Content-Security-Policy-Report-Only is incorrectly configures on the domain app.hubspot.com where this is the directive:

 

frame-ancestors 'self'; report-uri ...

 

As far as I understand how frame-ancestors works, this directive is basically saying that only app.hubspot.com can use the reporting API? However the idea of the Reporting API is that clients send their issues to it when an error or issues occrurs in their browser. Hence I believe the correct change to remove these errors in clients browsers would be to remove the frame-ancestorsdirective.

 

More information is available here: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only

1 Accepted solution

Accepted Solutions
dennisedson
Solution
Community Manager

OK everyone, I have been told that a fix has been deployed.  Let me know what you all are seeing out there now 😀

Thanks,

Dennis


We are excited to announce that the Community will be launching a weekly newsletter on November 2, 2020!
Sign up today!

View solution in original post

23 Replies 23
dennisedson
Community Manager

Hey @AndrewHo 

Welcome to the Community!

Could you send a link to where the form is embedded so we can take a look?

Thanks,

Dennis


We are excited to announce that the Community will be launching a weekly newsletter on November 2, 2020!
Sign up today!
0 Upvotes
toscanabike
Member

I also have the same error, plus I cannot see the form properly in mobile... if someone can help, it would be very appreciated. The link is https://toscanabike.it/escursioni_mtb/da-lucca-a-viareggio-in-mountain-bike-nuova-variante/

 

thanx

dennisedson
Community Manager

Hi @toscanabike ,

I am seeing an error on your site, but it is not the same.

It is Uncaught TypeError: hbspt.forms.create is not a function

@LisbethN asked the same question here.

I would look at the steps in that post to see if that helps out.

 

Thanks,

Dennis


We are excited to announce that the Community will be launching a weekly newsletter on November 2, 2020!
Sign up today!
0 Upvotes
FFraga
Member

Hi, I'm having the same issue. Page: https://www.kaimaging.com/medical-solutions/reveal-35c-medical/

Content Security Policy of your site blocks some resources because their origin is not included in the content security policy header

 

How's the best way to solve this?

GCiampa
Participant

I am having this same issue! Has anyone managed to resolve it?

0 Upvotes
dennisedson
Community Manager

The best bet would be work with your site admin to update the content security policy

Here is some documentation on it.

Thanks,

Dennis


We are excited to announce that the Community will be launching a weekly newsletter on November 2, 2020!
Sign up today!
0 Upvotes
tinyfly
Member

The original poster is correct, this needs to be handled by Hubspot. The frame-ancestors content security policy setting is on Hubspot's side to change. In Hubspot's CSP for `https://app.hubspot.com/` frame-ancestors is set to 'self'. This means that `https://app.hubspot.com` is only allowed to be loaded on app.hubspot.com itself and not in an iframe on any other domains.

 

However, when you use the form embed code it tries to load `https://app.hubspot.com/forms-next-v2-captcha` as part of the payload. So this either needs to be moved to another domain that is allowed to be embedded in iframes or remove the frame-ancestors directive from the app.hubspot.com CSP.

0 Upvotes
GCiampa
Participant

Hi all, we managed to resolve this issue. In our case, it was because our site did not support iframes. Every Hubspot code is essentially, in an iframe. It took some work form our developer but it was a pretty quick fix.

0 Upvotes
IWatt
Participant

That's great news, GCiampa. Could your developer provide any guidance as to what the fix was? We are really struggling here with this same issue and would love to see if we could replicate your approach.

0 Upvotes
04705
Participant

Same issue is causing your scripts such as forms.hubspot.com from loading in Firefox, Chrome and Safari (browsers detecting it as an invalid CORS request and blocking it), because of this our lead captures from forms aren't working.

0 Upvotes
Dpontarelli
Member | Gold Partner

Hello, we're having the exact same issue with the Content Security policy. Has anyone resolved this yet? 

0 Upvotes
CAndres
Participant

@dennisedson This seems like it can only be fixed on HubSpot's side. 
Could you confirm if HubSpot acknowledges that's the case and if they plan to work on a fix? 




0 Upvotes
dennisedson
Community Manager

Hey all, The team is looking into this.  I will report back when I have an update.

Thanks,

Dennis


We are excited to announce that the Community will be launching a weekly newsletter on November 2, 2020!
Sign up today!
Jeff_videommerc
Member

Hi Dennis, did you solve this issue? now even the messages are not delivered via HubSpot forms

dennisedson
Community Manager

The team is looking into it.  Will report back when I have confirmed the resolution

Thanks,

Dennis


We are excited to announce that the Community will be launching a weekly newsletter on November 2, 2020!
Sign up today!
0 Upvotes
philipcron
Participant

Same situation here. I tried to update things on my end but it did not fix the issue. Hoping for a fix on HubSpot's side.

https://kpstaffing.com/ 

0 Upvotes
AlbertoSM
Participant | Partner

I have the same issue. Any news?

0 Upvotes
dennisedson
Community Manager

@AlbertoSM , not yet, but I do know that it is being worked on.

Thanks,

Dennis


We are excited to announce that the Community will be launching a weekly newsletter on November 2, 2020!
Sign up today!
0 Upvotes
dennisedson
Solution
Community Manager

OK everyone, I have been told that a fix has been deployed.  Let me know what you all are seeing out there now 😀

Thanks,

Dennis


We are excited to announce that the Community will be launching a weekly newsletter on November 2, 2020!
Sign up today!

View solution in original post

FFraga
Member

it seems to be all good now, thanks!

AlbertoSM
Participant | Partner

It works now, thank you!

EFinnestead
Member

We've had the same issue and it is causing problems with our google ads becasue the link is being rejected. Since there as been a fix, do we need to update our forms and reload?

0 Upvotes
dennisedson
Community Manager

@EFinnestead , I don't think there is anything that needs to be done on your end 😀

Thanks,

Dennis


We are excited to announce that the Community will be launching a weekly newsletter on November 2, 2020!
Sign up today!
0 Upvotes