0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

脆弱性検証(CVE-2023-22518)

Last updated at Posted at 2023-12-24

脆弱性概要

Confluence Data Center および Confluence Server における不適切な認証の脆弱性
悪用された場合、リモートの攻撃者から Confluence をリセットされ、管理者アカウントを作成される可能性がある

影響を受けるバージョン

Confluence Data Center および Confluence Server

  • 修正バージョンより前のすべてのバージョン

修正バージョン

Confluence Data Center および Confluence Server

  • 7.19.16
  • 8.3.4
  • 8.4.4
  • 8.5.3
  • 8.6.1

PoC

脆弱性の詳細

Confluence ではサイトを XML ZIP 形式でダウンロードすることでバックアップファイルを保存、またはバックアップファイルをアップロードすることでサイトを復元できる。

不適切な認証の脆弱性により、/json/setup-restore.action に対して細工したバックアップファイルをアップロードされ、Confluence をリセットされる可能性がある。

バックアップファイルをアップロードすることでサイトを復元する RestoreAction クラスに対するリクエスト /admin/restore.action は認証機能 WebSudo(管理操作の実行前に再度パスワードを要求する)によって保護され、SetupRestoreAction クラスに対するリクエスト /setup/setup-restore.action はセットアップ完了メッセージの表示画面またはログイン画面などにリダイレクトされる。
/json は /admin を継承し、/admin は /setup を継承しているため、/json を指定することで WebSudo による認証なしで setup-restore.action にアクセスできる。

SetupRestoreAction クラスにおけるセキュリティトークンの検証を回避するため、ヘッダ X-Atlassian-Token: no-check を指定、また復元処理実行中の /json/setup-restore-progress.action に対するリダイレクトを回避するため、同期処理を強制するパラメータ synchronous=true を指定する必要がある。

攻撃者はこの脆弱性を悪用して /json/setup-restore.action に細工したバックアップファイルをアップロードすることができる。

検証環境

  • Confluence Server 8.3.2
  • PostgreSQL 15.5

環境構築

Docker イメージから Confluence Server を起動(検証用のネットワーク vrfy を指定)

docker run --name "confluence-server-8.3.2" -d -p 8090:8090 -p 8091:8091 --network "vrfy" atlassian/confluence-server:8.3.2

Docker イメージから PostgreSQL を起動(検証用のネットワーク vrfy を指定)

docker run --name "postgres-15.5" -d -e POSTGRES_PASSWORD=password -p 5432:5432 --network "vrfy" postgres:15.5

PostgreSQL に接続してユーザ、データベースを作成

docker exec -it postgres-15.5 psql -U postgres
psql (15.5 (Debian 15.5-1.pgdg120+1))
Type "help" for help.

postgres=# 
postgres=# CREATE USER test_user WITH PASSWORD 'test_pass';
CREATE ROLE
postgres=# CREATE DATABASE test_db1 OWNER test_user;
CREATE DATABASE

ブラウザから http://localhost:8090 にアクセスして Confluence をセットアップ

Screenshot_001.png

Screenshot_002.png

脆弱性検証

アップロードするバックアップファイルは復元する管理者アカウント情報を含む

Screenshot_007.png

Screenshot_008.png

http://localhost:8090/json/setup-restore.action?synchronous=true に対してバックアップファイルをアップロードする

Screenshot_009.png

Screenshot_010.png

脆弱性修正バージョンでは http://localhost:8090/login.action?os_destination=%2Fnotpermitted.action&permissionViolation=true にリダイレクトされる

Screenshot_011.png

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?