我发现这不起作用:
<iframe src="http://www.yahoo.com"> </iframe>
Run Code Online (Sandbox Code Playgroud)
我已经阅读了这个问题,但我不明白他们的意思是添加:
<?php
header('X-Frame-Options: GOFORIT');
?>
Run Code Online (Sandbox Code Playgroud)
我试着将它添加到我的html文件的顶部(当然,将其更改为php文件),我的php文件变为:
<?php
header('X-Frame-Options: GOFORIT');
?>
<iframe src="http://www.yahoo.com"> </iframe>
Run Code Online (Sandbox Code Playgroud)
我在我的appserv(使用php 5.2.6)中运行它,它不起作用.任何人都可以解释我应该做些什么才能克服这个问题?
这些 HTTP 标头似乎做同样的事情,尽管后者具有更大的灵活性。
Content-Security-Policy 是否提供任何额外的安全性?
security http http-headers x-frame-options content-security-policy
我在 web.config 中添加了 X-frame-Options。
这是我的 web.config
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
<httpProtocol>
<customHeaders>
<add name="X-Frame-Options" value="SAMEORIGIN" />
</customHeaders>
</httpProtocol>
Run Code Online (Sandbox Code Playgroud)
重新启动 IIS 后出现 500 错误!!!
有人可以帮我找出问题吗?
我正在尝试制作一个以phoenix-framework为后端的shopify应用程序。我一直在按照本教程在 Shopify 后台加载我的应用程序,我需要修改x-frame-options标头。
这是我的插头:
@doc false
def init(opts \\ %{}), do: Enum.into(opts, %{})
@doc false
def call(%{params: %{"shop" => shopify_domain}} = conn, _opts) do
IO.puts("++++++++++ Plug Call ++++++++++++++")
IO.inspect(shopify_domain)
# %{"shopify_domain" => shopify_domain_only} = shopify_domain
shop = ShopifyApp.find_shop_by(shopify_domain)
allow_shop_or_halt(conn, shop)
end
def call(conn, _opts), do: conn
defp allow_shop_or_halt(conn, nil), do: Conn.halt(conn)
defp allow_shop_or_halt(conn, shop) do
conn
|> Conn.put_private(:shop, shop)
|> Conn.put_resp_header("x-frame-options", "ALLOW-FROM https://#{shop.shopify_domain}/")
end
Run Code Online (Sandbox Code Playgroud)
但 Chrome 浏览器的控制台抱怨说:
加载时遇到无效的“X-Frame-Options”标头.....:ALLOW-FROM https://skbeautysupply.myshopify.com/ '不是可识别的指令。标头将被忽略。
我在这里缺少什么?
我为 Microsoft Teams 创建了一个选项卡。将其添加到频道后,它会显示错误:
拒绝在框架中显示“URL”,因为它将“X-Frame-Options”设置为“sameorigin”。
该选项卡应该加载 Azure 中托管的应用程序,该应用程序与外部域建立连接。
如果我使用此代码行:
<iframe src="https://www.google.com/" frameborder="0"></iframe>
Run Code Online (Sandbox Code Playgroud)
浏览器将拒绝访问该网站。
但是如果我使用这个 src,突然它就可以工作了:
<iframe src="https://www.google.com/webhp?igu=1" frameborder="0"></iframe>
Run Code Online (Sandbox Code Playgroud)
我已经看到有几个网站的常规域名不能作为 iframe 工作,但添加了诸如 iframe 之类的功能,/webhp?igu=1使其可以工作。
谢谢 !
我正在做一个Web应用程序测试,发现在具有多个x-frame-options标头条目时存在一些漏洞。哪些浏览器容易受到多个x帧选项的攻击?
Multiple x-frame-options标头条目可能受到哪些攻击?ClickJacking似乎是一种很难的方法,因为在新的浏览器中无法实现。
我想忽略我网站上的 X-frame 标头,以便 iframe 可以加载外部网站。有像 这样的chrome 扩展,效果非常好。我如何通过javascript实现相同的概念?
我目前正在开发一个用于angularjs客户端和Web API 2服务器端的网站。
首先,我尝试SSRS使用iframe. iframe每当我向 src 提供以下(示例)链接时,我就可以成功嵌入报告:
http://EXAMPLE-LINK/reports/report/Test%20Upgrade/Line%20Control?rs:embed=true
下图是成功加载到网站的报告(快乐的日子):
其次,每当我使用相同的链接但这次为其提供参数来填充“Between”和“And”字段时,我都会收到以下控制台错误:
我正在使用的包含参数的链接详细如下:
iframe最后,当我向src 提供带有参数的链接 时,为什么会出现X-Frame-Options 'SAMEORIGIN'错误?理想情况下,我想为iframesrc 提供参数,否则我将不得不创建多个报告来实现网站功能。
我可以在应用程序中执行哪些操作来忽略/删除X-Frame-Options 'SAMEORIGIN'标头响应?我是否需要在我的网络应用程序启动过程中添加一些customHeader响应web.config,或者有什么方法可以删除标头?
我正在使用 Spring Security 5.1.5.RELEASE 并尝试设置ALLOW FROM为X-Frame-Options
我使用WhiteListedAllowFromStrategy并将 URL 列表传递给白名单,尽管header发送的是X-Frame-Options: DENY
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
@Override
public void configure(HttpSecurity http) throws Exception {
String permittedRoutes [] = {"/", "/register"};
http
.headers()
.frameOptions()
.disable()
.addHeaderWriter(new XFrameOptionsHeaderWriter(new WhiteListedAllowFromStrategy(Arrays.asList("https://google.com"))));
http
.authorizeRequests()
.antMatchers(permittedRoutes).permitAll()
.and()
.authorizeRequests()
.antMatchers("/**").authenticated()
.and()
.formLogin()
.loginPage("/")
.defaultSuccessUrl("/home", true)
.permitAll()
.and()
.logout()
.logoutRequestMatcher(new AntPathRequestMatcher("/logout"))
.permitAll()
.invalidateHttpSession(true)
.clearAuthentication(true)
.deleteCookies("JSESSIONID")
.logoutSuccessUrl("/?logout");
}
@Override
public void configure(WebSecurity web) {
web
.ignoring()
.antMatchers("/assets/**", "/css/**", "/images/**", "/js/**", "/fonts/**", …Run Code Online (Sandbox Code Playgroud) 我正在尝试将我的 Google Apps 脚本 Web 应用程序嵌入到另一个域上的 iFrame 中,但该 Web 应用程序未加载,我只看到白屏。webinspector 中也没有错误。
Web 应用程序的发布方式为:以我的身份执行,并且可以访问给定域内的任何人。
根据这个我实现了我的 doGet 方法,如下所示:
function doGet(e) {
return HtmlService
.createHtmlOutputFromFile('html/index')
.setXFrameOptionsMode(HtmlService.XFrameOptionsMode.ALLOWALL);
}
Run Code Online (Sandbox Code Playgroud)
IFrame 看起来像这样:
<iframe src="https://script.google.com/a/my_domain/macros/s/ADjidojcojv/exec" title="test" width="558" height="300"></iframe>
Run Code Online (Sandbox Code Playgroud)
当用户登录 Google 时,将显示 web 应用程序。但是,当用户未登录灰色图像时account.google.com refused to connect
我认为原因是有一个重定向到谷歌登录不允许显示。此外,在这种情况下,还有另一个到 SAML SSO 应用程序的重定向。因此,当您正常登录 google 时,您将重定向到 SAML SSO 登录。
我在这里有什么选择?
[编辑]我发现有人有完全相同的问题和一个可能的解决方案。显然没有简单的方法可以做到这一点......
iframe web-applications same-origin-policy google-apps-script x-frame-options
我正在制作一个 chrome 扩展,其中有一个 iframe。当扩展程序请求服务器以获取页面时,它会返回错误Refused to display 'https://subdomain.example.com/' in a frame because it set 'X-Frame-Options' to 'deny'。尽管我已在我的文件中设置了x-frame-optionsto并在后端项目的特定方法中添加了 a ,但它返回了另一个错误。我在我的文件中添加了和。不走运,它返回了,所以我删除了权限并添加了v3 的权限。没有结果!!然后我添加了deny.htaccessheader('x-frame-options: GOFORIT')Refused to display 'https://subdomain.example.com/' in a frame because it set multiple 'X-Frame-Options' headers with conflicting values ('GOFORIT, DENY'). Falling back to 'deny'webRequestwebRequestBlockingpermissionsmanifest.json'webRequestBlocking' requires manifest version of 2 or lowerUnchecked runtime.lastError: You do not have permission to use blocking webRequest listeners. Be sure to declare the webRequestBlocking permission …
javascript google-chrome google-chrome-extension x-frame-options chrome-extension-manifest-v3
x-frame-options ×12
iframe ×5
javascript ×3
security ×2
api ×1
c# ×1
chrome-extension-manifest-v3 ×1
elixir ×1
frames ×1
html ×1
http ×1
http-headers ×1
iis ×1
php ×1
spring ×1
testing ×1