问题标签 [browser-security]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
internet-explorer - IE11 上的 IFrame:此内容无法在框架中显示 - 调用同一个域
我们有一个内部网站在 IFrame 中加载页面。以前我们不小心将 IFrame 设置为从位于不同域的错误环境中加载页面,因此内部用户遇到了“此内容无法在框架中显示”的消息。我们很快发现这是因为页面位于错误的环境中,并更新了 URL,以便 IFrame 及其父级调用来自同一域的页面。
问题是遇到初始问题的用户之一仍然收到消息“此内容无法在框架中显示”,我们不确定原因。
我们尝试过:
- 清除浏览器缓存
- 使用 将 IE 重置为其默认设置
RunDll32.exe InetCpl.cpl,ResetIEtoDefaults
- 重新安装 IE
- 在 Microsoft 的新 IE11 VM 上重现该问题:https ://developer.microsoft.com/en-us/microsoft-edge/tools/vms/这是不成功的,IFrame 加载了内容。
没有其他人遇到此问题,我们想知道还有什么可能导致此问题。
angular - 如何保留标签之间登录的用户会话?
在 Angular 应用程序中,我试图保留用户的logged_in
属性,直到他使用localStorage
. 虽然数据是加密保存的localStorage
,但我们可以在用户注销后手动复制数据并粘贴进去,那么这里的安全性就被破坏了(我们将能够访问应用程序而无需仅使用加密密钥登录)。我们怎样才能实现这个功能?如果用户关闭所有选项卡,则用户退出是可以的。而不是使用localStorage
// SessionStorage
,Cookie
我们怎样才能做到这一点?实现这一点的最佳方法是什么?
asp.net - Firefox 在发送标头“Content-Security-Policy”时清除所有内联样式属性
为什么添加以下标头会导致 Firefox 在浏览器中呈现时仅清空所有 style="" 属性?
Chrome 和 Edge 浏览器显示所有内容正确,这意味着样式属性的值未清除为“”。
flutter - 使用基于 Web 的 Flutter 应用进行身份验证
我想构建一个 Flutter 应用程序,人们可以在其中登录并发布内容供其他用户查看。我希望这个应用程序可以在浏览器中访问,并认为我可以使用 Flutter-Web。
我可以在具有本地数据库的服务器上运行颤振应用程序,但问题是如果一个用户访问该页面并登录,那么其他所有人也都以该用户身份登录。
我能看到的唯一解决方案是,如果每个人都将我的 Flutter 应用程序下载到他们的本地机器上,启动一个实例,然后所有这些实例都与远程数据库通信。
我可以使用远程数据库,虽然我不喜欢它,但我不希望人们安装任何东西。
有没有办法通过服务多个颤振实例,每个浏览器会话一个?
javascript - Browser blocking Mathjax on app engine static page
I am trying to serve a static page containing Tex-style Math that is to be rendered by Mathjax. The pages are being served by a Flask app on Google app engine. Problem is - Chrome, Opera and Edge - all browsers are blocking Mathjax from rendering the Math, but it works properly if I manually unblock it from on top of the browser every time the page loads. The site works perfectly offline, but the problem occurs when the page is accessed through the app engine app. Any way to prevent the browser from blocking the script? Note that Mathjax is being loaded from the official CDN, but I have also tried using a local copy.
Example link: https://20200407t065833-dot-clip-sync-03.appspot.com/book_preview_chapter_1
javascript - 为什么我 *inconsistently* 得到 DOMException: Blocked a frame with origin "https://ec2b.foo.com" from access a cross-origin frame
这是我的代码
如果我加载我的https://ec2b.foo.com/console/login2020.jsp
页面DOMException: Blocked a frame with origin "https://ec2b.foo.com" from accessing a cross-origin frame.
如果我在 /etc/hosts 中添加一个条目143.67.75.100 ec2b
,然后在页面https://ec2b/console/login2020.jsp
正常工作时加载我的页面,并且我的控制台会记录 href。
奥秘在于我打开的窗口的 URL 没有指定来源,所以我不明白 Chrome 怎么会抱怨我的请求是跨域的。
该代码仅存在于一台服务器上,因此 ec2b 和 ec2b.foo.com 不可能不同。也通过 dig 确认。我在 Chrome 和 Firefox 中都尝试过,结果相同,尽管在 Firefox 的情况下,tl2010handle 变量在第一种情况下未设置,而在第二种情况下设置。
security - 浏览器的服务工作者可以轻松访问制作僵尸网络?
我一直在阅读有关服务人员的信息,以使用它的一些功能使我的应用程序更加快速和可靠。当我看到服务工作者和持久存储使 webapp 拥有所有原生应用程序功能的可能性时,我感到很兴奋,但我也有这个想法。
如果有人想制作僵尸网络怎么办?他们只是将他们的网站链接发送给一些用户,仅此而已,服务人员被安装在世界各地的许多浏览器中。现在,网站所有者可以用这个僵尸网络做很多事情,比如进行 ddos 攻击、加密挖掘等。我认为它甚至可以让黑客更容易利用一些浏览器漏洞。
我错过了什么吗?
tls1.2 - 如何测试用户的浏览器是否支持某些密码并在不支持时显示友好消息
In very short, how can I show the visitors of my website with a message if their browser/client doesn't support any of the TLS cipher-suite enabled on the application web server?
I have an existing web-application that attracts a lot of users. Due to security reasons, I want to enable only certain secure ciphers on the webserver and disable all weak TLS ciphers. This will possibly restrict some users to access my website if their browser doesn't support any of the allowed ciphers. In such a case, I want to show a friendly message to those users on their browser, instead of any default message from the browser.
我能想到的一种方法是: 在用户访问我的网站时向他们显示一个弹出窗口。我不确定是否还有其他更好的方法可以实现这一目标。因此,我正在寻求一些解决方案来实现被广泛使用和接受的预期结果。
angular - JavaScript 中的嵌套字符串插值
在尝试动态生成URL时,我最终嵌套了如下插值:
这工作正常,但我担心这是否会在 Angular 构建的应用程序中带来任何安全漏洞。
security - 子 iframe 对第三方代码执行绝对安全吗?
我正在一个网站上接收第三方不受信任的 Javascript 作为字符串,并且需要eval()
它。该站点具有不受信任的代码无法访问的敏感 cookie 和 localStorage。
为了解决这个问题,我iframe
在同一个域中创建了一个子页面,allow-scripts
作为唯一的沙盒属性:
<iframe src="..." sandbox="allow-scripts"></iframe>
孩子iframe
有一个预设方法列表,它可以根据来自父母的预期有效负载使用window.postMessage
. 子进程接收包含要执行的不受信任代码的父负载,eval()
并通过 将响应作为字符串返回给父负载window.postMessage
。
我已经测试并验证了孩子iframe
无法访问父 cookie 或 localStorage。
AFAIK 这是安全的,但我想从该地区有经验的人那里知道。