- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
Google 要求我解决 https://support.google.com/faqs/answer/9095419在我的 Android 应用程序中,这基本上意味着不对通过 HTTP 加载的网页使用 JavaScript 注入(inject)机制。
不使用此机制(选项 1)对我不起作用。将 android:usesCleartextTraffic 设置为 false 也不起作用,因为应用程序在其他地方使用非 HTTPS 流量。所以这给我留下了“你可以确保任何受影响的 WebView 不会通过 loadUrl 加载任何具有 HTTP 方案的 URL”——我很乐意这样做,因为我的应用程序只使用 file:///URL 将内容加载到 WebView ,这在安全方面应该很好。但是,我需要如何编写 shouldOverrideUrlLoading 方法的代码,以便 Google 的检查器识别出我只使用了 file:///URL?
注意这个问题不同于Remediation for JavaScript Interface Injection Vulnerability (因为我很清楚被问到的是什么)和In Android, JavaScript Interface Injection Vulnerability (因为我没有使用 HTTP,而是使用 file:///URL)。
编辑:添加我的 shouldOverrideUrlLoading 方法。 (这不是整个方法,而是它的重要部分。)
@Override
public boolean shouldOverrideUrlLoading (WebView browser, String url) {
if (url.startsWith("file:///")) {
// This is my web site, so do not override; let my WebView load the page
browser.loadUrl(url);
return true;
}
// Otherwise, the link is not for a page on my site, or is an entirely different kind of URI
// (like tel:, geo: or mailto:), so launch another Activity that handles URLs
act.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
return true;
}
最佳答案
我还没有找到以满足谷歌代码检查器的方式将 file://URLs 与 Assets 一起使用的方法。虽然这可以解决问题,但我仍然不清楚人们可能需要如何对其进行编码。
我最终做的是通过 WebView.evaluateJavascript 方法调用 JavaScript 方法,这解决了我眼前的问题。当从 WebViewClient.onPageFinished 中调用时,页面已完成加载,因此所有元素都可以访问。虽然对我的情况不重要,但此方法也可以向 Java 代码返回一个值。因此,虽然它不是 JavascriptInterface 的一般替代品,但它解决了它的一些用例。
关于android - 如何解决 "Remediation for JavaScript Interface Injection Vulnerability"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53705818/
在最近的安全公告中,微软警告说“小工具中的漏洞可能允许远程执行代码”: An attacker who successfully exploited a Gadget vulnerability co
我越来越多地致力于防止 xss 攻击,我这样做的方法之一是查找和修复漏洞。我注意到我在记录的许多攻击中都看到了 document.vulnerable。 我似乎找不到太多关于此的文档,所以我想知道它的
所以我对 JavaScript 比较陌生,尽管我一直在做 HTML/CSS UI 前端工作(我知道这是亵渎),并且正在开发我自己的样板文件以用于 future 的元素。我对从 XSS、CodeInje
在我的 Android 应用程序中,我使用 Deezer SDK 来播放轨道。我最近收到一封来自 Google 的电子邮件,主题如下:“Google Play 警告:SSL 错误处理程序漏洞”。在这封
我必须验证一个运行 glibc-2.9 的 64 位系统上的漏洞。 http://scarybeastsecurity.blogspot.in/2011/02/i-got-accidental-cod
最近三天我研究了如何使用 XMLHttpRequest 进行跨域请求。最好的选择确实是我已经在使用的 JSONP。 但我仍然有一个问题,我无法在任何地方找到答案。我阅读了数百篇文章(包括 SO),但没
我非常担心我构建的网络应用程序的安全性,因此我一直在使用各种工具来抓取我的每个应用程序。 虽然在编程方面可以完成的所有事情都已经完成,但现成的类(如 Active Record)无法预见,但有一个问题
下面的简单 java 代码获取 Fortify Path Manipulation 错误。请帮我解决这个问题。我挣扎了很长时间。 public class Test { public stat
我已在 Azure 中创建了一个 Windows VM,但该 VM 未安装 SQL。 但是,我发现以下合规性问题 SQL servers on machines should have vulnera
是devise通过正常的 http://连接容易受到 session 劫持吗?我无法从文档中弄清楚它。 最佳答案 是的。Rails 管理 session 的默认方式很容易被劫持。 这是因为它将客户端进
嘿,有人可以帮我处理这段代码吗?(visual studio 给我一个警告 ca2100,我不知道该怎么做,谷歌上的解决方案我没有成为他们工作 xD) 谢谢 private void Updatebt
Google 要求我解决 https://support.google.com/faqs/answer/9095419在我的 Android 应用程序中,这基本上意味着不对通过 HTTP 加载的网页使
我确信许多人可以通过搜索文件来查找 bash 漏洞模式而受益。 最佳答案 grep -R '\(\)\{ *: *;\}' * 从一个目录开始,这将在所有文件中递归地搜索该模式。 关于regex -
这个问题不太可能帮助任何 future 的访问者;它只与一个小的地理区域、一个特定的时间点或一个非常狭窄的情况有关,这些情况并不普遍适用于互联网的全局受众。为了帮助使这个问题更广泛地适用,visit
我的页面中有一个元素列表,我想对其应用 jQuery 滑动动画。但是,我希望动画按顺序链接起来,即只有当前一个元素的动画完成时,一个元素才会开始其动画。 列表的长度是可变的,所以我需要找到一个动态的解
我在我的应用中使用了 gorbin/ASNE SDK。我最近收到一封来自 Google 的电子邮件,主题如下:“Google Play 警告:SSL 错误处理程序漏洞”。在这封电子邮件中,Google
我在 Java 中有这个 Controller : @Controller public class AuthenticationController extends AbstractControll
我收到以下信息 golintci信息: testdrive/utils.go:92:16: G110: Potential DoS vulnerability via decompression bo
解决方案资源管理器中的奇怪消息。 ef1000“可能的sql注入(inject)漏洞” 它不会阻止编译,没有错误,没有警告,“错误列表”中没有消息。 编译输出中没有类似的消息... 单击不会将焦点移至
我想用 Wapiti 测试我们的 Web 应用程序扫描器。在我的场景中,我假设攻击者是经过身份验证的用户。如何配置 Wapiti 以在我们的登录表单上使用特定的用户名和密码,以便我可以测试其背后的页面
我是一名优秀的程序员,十分优秀!