Skip to content

fix(pages): Let the 500 page's links escape their iframe (backport #585) - #586

Merged
balamurali27 merged 2 commits into
masterfrom
mergify/bp/master/pr-585
Aug 18, 2026
Merged

fix(pages): Let the 500 page's links escape their iframe (backport #585)#586
balamurali27 merged 2 commits into
masterfrom
mergify/bp/master/pr-585

Conversation

@mergify

@mergify mergify Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Problem

Both links on the 500 page are dead in the browser. Clicking either one shows a browser security page instead of the destination:

Firefox Can't Open This Page — To protect your security, docs.frappe.io will not allow Firefox to display the page if another site has embedded it.

nginx does not serve this page directly. It injects it through sub_filter as a frame:

map $upstream_status $internal_server_error_page_... {
    500     '<style>...</style><iframe src="/internal_server_error.html"></iframe><div hidden>';

An anchor with no target navigates the frame it lives in, so the destination is asked to render inside that iframe. Both destinations refuse:

$ curl -sI https://docs.frappe.io/cloud/performance-error-debugging | grep -i x-frame
x-frame-options: SAMEORIGIN
$ curl -sI https://frappecloud.com/dashboard/ | grep -i x-frame
x-frame-options: SAMEORIGIN

This is live on develop and affects both the troubleshooting guide button and the web.error.log link added in #581.

Fix

target="_blank" on both anchors. A new top-level tab is never framed, so X-Frame-Options does not apply to it.

_top would also have worked, but it replaces the error page. _blank leaves it on screen, which keeps the visited-link colour visible — useful when someone attaches a screenshot to a support ticket and we want to see whether they already opened the guide.

Test

test_iframed_pages_escape_the_frame reads the nginx template, finds which pages get wrapped in an iframe, and requires every external link on those pages to carry a target that escapes the frame (_blank or _top). Checked against the pre-fix page, it flags both anchors, so it fails without this change rather than passing vacuously.

🤖 Generated with Claude Code


This is an automatic backport of pull request #585 done by [Mergify](https://mergify.com).

balamurali27 and others added 2 commits August 18, 2026 11:20
nginx injects this page as <iframe src="/internal_server_error.html">, so
a link without a target loads its destination inside the frame. Both
docs.frappe.io and frappecloud.com send X-Frame-Options: SAMEORIGIN, so
the browser refuses to render either one and shows a security error in
place of the page.

Predates this branch: the links on develop have the same problem.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
(cherry picked from commit 578efe5)
_blank escapes the iframe the same way _top does, since a new top-level
tab is never framed, and it leaves the error page on screen. That keeps
the visited-link colour visible for support screenshots.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
(cherry picked from commit ad61b7f)
@balamurali27
balamurali27 merged commit e386e65 into master Aug 18, 2026
2 of 5 checks passed
@balamurali27
balamurali27 deleted the mergify/bp/master/pr-585 branch August 18, 2026 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant