質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Vue.js

Vue.jsは、Webアプリケーションのインターフェースを構築するためのオープンソースJavaScriptフレームワークです。

Firebase

Firebaseは、Googleが提供するBasSサービスの一つ。リアルタイム通知可能、並びにアクセス制御ができるオブジェクトデータベース機能を備えます。さらに認証機能、アプリケーションのログ解析機能などの利用も可能です。

Firebase Authentication

Firebase Authenticationは、Firebaseを利用したユーザーの認証機能です。バックエンドサービス、SDK、アプリでのユーザー認証に使用できるUIライブラリが用意されています。

Cloud Firestore

Cloud Firestore は、自動スケーリングと高性能を実現し、アプリケーション開発を簡素化するように構築された NoSQLドキュメントデータベースです。

Q&A

0回答

2392閲覧

Firebase × Vue.js のSPAの脆弱性診断(OWASP ZAP)の警告解決

marfoy

総合スコア0

Vue.js

Vue.jsは、Webアプリケーションのインターフェースを構築するためのオープンソースJavaScriptフレームワークです。

Firebase

Firebaseは、Googleが提供するBasSサービスの一つ。リアルタイム通知可能、並びにアクセス制御ができるオブジェクトデータベース機能を備えます。さらに認証機能、アプリケーションのログ解析機能などの利用も可能です。

Firebase Authentication

Firebase Authenticationは、Firebaseを利用したユーザーの認証機能です。バックエンドサービス、SDK、アプリでのユーザー認証に使用できるUIライブラリが用意されています。

Cloud Firestore

Cloud Firestore は、自動スケーリングと高性能を実現し、アプリケーション開発を簡素化するように構築された NoSQLドキュメントデータベースです。

0グッド

0クリップ

投稿2020/07/10 06:30

編集2020/07/10 06:32

前提・実現したいこと

Firebase × Vue.js でシングルアプリケーションを開発しました。
セキュリティが気になったので、OWASP ZAPで脆弱性診断を実行し、でてきた問題を解決しています。

下記の問題については、firebase.jsonを修正することで解決できました。

  • X-Frame-Optionsヘッダーの欠如
  • 不完全なキャッシュ制御やPragma HTTP ヘッダー設定

しかし、下記の警告は色々と調べてみたものの、解決できませんでした。
①アプリケーションエラーの開示
⇒ Vue側の設定の問題?(vue.config.js)

②Session ID in URL Rewrite
⇒ Firestoreのメソッドを使用しているだけなので、セッションIDをURLに含めない方法がわからず。

③Cross-Domain Misconfiguration
⇒ ???

④不完全なキャッシュ制御やPragma HTTP ヘッダー設定
⇒ firebase.jsonで"Cache-Control"に"private, no-store, no-cache, must-revalidate"を設定したところ、私が開発したサイトのURLでの警告は消えた。

上記の警告は、そもそも致命的な脆弱性になり得るのか、どのように解決すればいいかをご教示頂きたいです。

警告内容詳細

①アプリケーションエラーの開示

Description: This page contains an error/warning message that may disclose sensitive information like the location of the file that produced the unhandled exception. This information can be used to launch further attacks against the web application. The alert could be a false positive if the error message is found inside a documentation page. URL: https://%project name%.firebaseapp.com/js/chunk-vendors.70ef397d.js Method: GET Evidence: internal error Solution: Review the source code of this page. Implement custom error pages. Consider implementing a mechanism to provide a unique error reference/identifier to the client (browser) while logging the details on the server side and not exposing them to the user.

②Session ID in URL Rewrite

Description: URL rewrite is used to track user session ID. The session ID may be disclosed via cross-site referer header. In addition, the session ID might be stored in browser history or server logs. URL: https://firestore.googleapis.com/google.firestore.v1.Firestore/Listen/channel?database=projects%project name%2Fdatabases%2F(default)&gsessionid=xxxxxxx=8&RID=xxx&SID=xxxxxxxx=0&AID=x&TYPE=xmlhttp&zx=xxxxxxx Method: GET URL: https://firestore.googleapis.com/google.firestore.v1.Firestore/Listen/channel?database=projects%2Fproject name3%2Fdatabases%2F(default)&VER=8&gsessionid=xxxxxxxx&SID=xxxxxxxx&RID=xxxxx&TYPE=terminate&zx=xxxxxxx Method: POST Solution: For secure content, put session ID in a cookie. To be even more secure consider using a combination of cookie and URL rewrite.

③Cross-Domain Misconfiguration

Descrption: Web browser data loading may be possible, due to a Cross Origin Resource Sharing (CORS) misconfiguration on the web server URL: https://fonts.gstatic.com/s/roboto/v20/xxxxxxxxxxxx.woff2 Method: GET Solution: Ensure that sensitive data is not available in an unauthenticated manner (using IP address white-listing, for instance). Configure the "Access-Control-Allow-Origin" HTTP header to a more restrictive set of domains, or remove all CORS headers entirely, to allow the web browser to enforce the Same Origin Policy (SOP) in a more restrictive manner. Other information: The CORS misconfiguration on the web server permits cross-domain read requests from arbitrary third party domains, using unauthenticated APIs on this domain. Web browser implementations do not permit arbitrary third parties to read the response from authenticated APIs, however. This reduces the risk somewhat. This misconfiguration could be used by an attacker to access data that is available in an unauthenticated manner, but which uses some other form of security, such as IP address white-listing.

④不完全なキャッシュ制御やPragma HTTP ヘッダー設定

Description: The cache-control and pragma HTTP header have not been set properly or are missing allowing the browser and proxies to cache content. URL: https://firestore.googleapis.com/google.firestore.v1.Firestore/Listen/channel?database=projects%2Fproject name%2Fdatabases%2F(default)&gsessionid=xxxxxxx&VER=x&RID=xx&SID=xxxxxx&CI=x&AID=x&TYPE=xmlhttp&zx=xxxxxxxx&t=1 Method: GET

firebase.json

{ "hosting": { "public": "dist", "ignore": [ "firebase.json", "**/.*", "**/node_modules/**" ], "rewrites": [ { "source": "**", "destination": "/index.html" } ], "headers":[ { "source": "**", "headers":[ { "key": "X-Frame-Options", "value": "DENY" }, { "key": "Cache-Control", "value": "private, no-store, no-cache, must-revalidate" }, { "key": "X-Content-Type-Options", "value": "nosniff" }, { "key": "X-XSS-Protection", "value": "1; mode=block" } ] } ] } }

Vue.config.js

module.exports = { transpileDependencies: [ "vuetify" ], configureWebpack: { devtool: 'source-map' }, pwa: { iconPaths: { favicon16: 'favicon.png', favicon32: 'favicon.png', } } }

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだ回答がついていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問