无法对使用 Firebase 的服务执行 OWASAP ZAP 漏洞诊断

发布于 2025-01-12 04:32:13 字数 610 浏览 7 评论 0原文

我使用 OWASP ZAP 来诊断我自己的 Web 服务中的漏洞。 但是,Web 服务功能无法通过 ZAP 代理正常工作。检查ZAP日志时发现以下URL通信出现错误,返回504(Gateway Timeout)状态码。

https://firestore.googleapis.com/google.firestore.v1.Firestore/Listen/channel?database=xxxxxx

Firebase 不仅使用 Firestore,还使用 ​​Firebase 身份验证。不过,Firebase 身份验证似乎有效。 有谁知道为什么 Firestore 通信会导致 504 错误?

Web服务的环境如下。

Next.js (Vercel)

Using Firebase functions:
Firebase Authentication
Firebase Storage
Firebase Firestore

※ Firestore and storage can only be accessed by accounts authenticated by Firebase Authentication.

如果有人熟悉的话请教我。

I use OWASP ZAP to diagnose vulnerabilities in my own web service.
However, the web service function does not work properly via the ZAP proxy. When I checked the ZAP log, an error occurred in the communication of the following URL, and the status code of 504 (Gateway Timeout) was returned.

https://firestore.googleapis.com/google.firestore.v1.Firestore/Listen/channel?database=xxxxxx

Firebase uses not only Firestore, but also Firebase Authentication. However, Firebase Authentication seems to be working.
Does anyone know why Firestore communication causes a 504 error?

The environment of the Web service is as follows.

Next.js (Vercel)

Using Firebase functions:
Firebase Authentication
Firebase Storage
Firebase Firestore

※ Firestore and storage can only be accessed by accounts authenticated by Firebase Authentication.

If anyone is familiar with it, please teach me.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

路弥 2025-01-19 04:32:13

我已经看到这个问题,经过一些研究发现 ZAP 尚不支持流连接,并且 Firestore 在服务器发送数据后保持网络请求打开(以防万一它想向客户端发送更多数据)。

启用experimentalAutoDetectLongPolling< /a>,这会强制 Firestore 尽快关闭连接,从而允许 ZAP 正常工作。

为此:

firebase.initializeApp({
  ...
});
firebase.firestore().settings({experimentalForceLongPolling: true});

I've seen this issue, and after some research found that ZAP does not support streaming connections yet and that Firestore keeps network requests open after the server sends data (just in case it wants to send more back the client).

Enabling experimentalAutoDetectLongPolling, which forces Firestore to close a connection ASAP, allowed ZAP to work properly.

To do this:

firebase.initializeApp({
  ...
});
firebase.firestore().settings({experimentalForceLongPolling: true});
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文