
CVE-2020-28874
This repository contains the description of the vulnerability found (CVE-2020-28874) in ProjectSend r1270 release.
改善を促してくれた Entelgy Innotec Security の同僚に感謝します。
脆弱性はパスワードリセットコンポーネントにあります。攻撃者は有効なトークンを必要とせずに、admin などの既知のユーザーのパスワードを、そのユーザー名だけで変更できます。
これは、バックエンドが、提供されたユーザー名から読み込んだユーザーデータで $user_data をクリアしないためです。
if (!empty($_GET['token']) && !empty($_GET['user'])) {
$got_token = $_GET['token'];
$got_user = $_GET['user'];
/**
* Get the user's id
*/
$user_data = get_user_by_username($got_user);
....
}
そして、その変数の状態を使ってパスワードリセットの処理を続行します。
if ($_POST) {
/**
* Clean the posted form values.
*/
$form_type = encode_html($_POST['form_type']);
switch ($form_type) {
----
case 'new_password':
if (!empty($user_data['id'])) {
$reset_password_new = $_POST['password'];
...
}
...
}
そのためには、攻撃者は POST リクエストを作成する必要があります。クエリ文字列には、無効な "token" パラメータと、ターゲットのユーザー名を指定した "user" パラメータを含めます。また、ボディ部には、“form_type” を “new_password” に、“password” を希望する新しいパスワードに、“csrf_token” を有効なもの(ログインフォームから取得できるもので、パスワードリセットフォームでは提供されません)に設定して追加する必要があります。
このリポジトリには、この脆弱性を悪用する Python スクリプトと、それをテストするための Docker コンテナが含まれています。
git clone https://github.com/varandinawer/CVE-2020-28874_CVE-2020-28875.git
cd ./CVE-2020-28874_CVE-2020-28875/docker-r1270
docker-compose up
#To finish the process of ProjectSend installation, go to http://localhost in the browser and follow the indication to setup an admin account
cd ..
python CVE-2020-28874.py --url http://localhost --user admin --pwd newAdminP4ssword*
バージョン r1295 以上にアップグレードしてください。