question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

frame-ancestors directive support in CSP on cdn.ampproject.org to protect from ClickJacking attack

See original GitHub issue

Currently in Google search results page AMP powered page is displayed inside iframe with source like https://foo-com.cdn.ampproject.org/c/s/foo.com/amp_document.html.. This source is for AMP cache. But this page also could be displayed in every other site inside such iframe (from AMP cache like cdn.ampproject.org), including malicious one. So there could be attack called Clickjacking.

Classic way to prevent such attack is to use X-Frame-Options: SAMEORIGIN HTTP response header in the web app. But AMP cache removes it because this iframe should be displayed from google.com (and it is not “same origin”). Another approach is to specify frame-ancestors directive in Content Security Policy. CSP is already added by Google AMP cache but without this directive. Also this directive could not be used in CSP specified via meta tag.

  1. What do you think about this security risk?
  2. Is it possible to add frame-ancestors into CSP policy of AMP cache with values for Google and Bing domains?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Gregablecommented, Oct 19, 2020

@oxdef Thanks for the details. It seems like the attack requires some form of credentials transfer via the CORS response to amp-list or similar components. This was not an angle I had considered.

I’m reviewing this with some security folks to better understand the attack surface. Since there is a security issue here, it’s considered P1 and will remain so unless we determine the risk is otherwise low.

0reactions
stale[bot]commented, Jun 19, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Clickjacking Defense - OWASP Cheat Sheet Series
This cheat sheet is intended to provide guidance for developers on how to defend against Clickjacking, also known as UI redress attacks.
Read more >
CSP frame-ancestors vs. X-Frame-Options for Clickjacking ...
Clickjacking (UI redressing) is a creative attack in which the attacker lures the victim into their site, frames YOUR site in and invisible ......
Read more >
Content-Security-Policy - HTTP - MDN Web Docs
Instructs user agents to treat all of a site's insecure URLs (those served over HTTP) as though they have been replaced with secure...
Read more >
Scan results for cloudcite.net - Security Headers
These are the scan results for cloudcite.net which scored the grade A.
Read more >
Results for www.who.int - European Union
Encrypted connections are a well-established technology to protect the privacy of web ... assets.sitescdn.net cdn.ampproject.org cdn.insight.sitefinity.com ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found