MariaDB version misleading if host is not allowed

オープン
#3,556 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
mariadb
領域
networking

調査の方向性

The bad match rules are the two match mysql lines near 2234-2236 of the nmap-service-probes file, which key the MariaDB version range on a single byte of the 'not allowed to connect' error packet. Compare that byte against the hexdump the reporter describes for a recent MariaDB server, and check whether a version scan can still tell the versions apart. Done means the unauthorized case no longer reports a version range that the byte cannot support, verified by a -sV scan against a MariaDB server that blocks the scanning host.

索引モデルが issue の本文から書いたものです。

説明

Nmap

Describe the bug
An nmap version scan (-sV) can produce wrong/misleading version information for MariaDB servers in some cases. If the MariaDB server has no user configured that is allowed to connect from the scanning host (message Host 'XX.XX.XX.XX' is not allowed to connect to this MariaDB server), then the version scan reports MariaDB 10.3.23 or earlier (unauthorized), which is misleading.

The source of this issue likely lies in nmap-service-probes, lines 2234-2236:

match mysql m|^.\0\0\0\xff..Host .* is not allowed to connect to this MariaDB server$|s p/MariaDB/ v/10.3.23 or earlier/ i/unauthorized/ cpe:/a:mariadb:mariadb/
# https://jira.mariadb.org/browse/MDEV-21101
match mysql m|^.\0\0\x01\xff..Host .* is not allowed to connect to this MariaDB server$|s p/MariaDB/ v/10.3.24 or later/ i/unauthorized/ cpe:/a:mariadb:mariadb/

The distinction was done based on one byte being 0x00 in version 10.3.23 and before and 0x01 from version 10.3.24 onwards. However, the byte's value got reverted back to 0x00 some time before MariaDB version 10.6.28, which is still the case for the most recent versions.
(Note that I wasn't able to determine exactly when this was changed, I only noticed it being the case in version 10.6.28 and later. If I find time, I will have a closer look at this.)

To Reproduce

  1. Set up a MariaDB server of a recent version, e.g. in a VM
  2. Make sure that no user is allowed to connect from the remote host
  3. Perform a version scan: nmap -sV -p 3306 <host>
  4. Perhaps, double check with nc <host> 3306 | hexdump -C that the first few bytes are xx 00 00 00 instead of xx 00 00 01

Expected behavior
From what I can tell, there is no way to accurately determine the MariaDB version in recent versions if the scanning host is blocked. nmap should report the version accordingly, or that the version could not be reliably determined.

Version info (please complete the following information):

  • OS: all
  • Output of nmap --version: 7.99
主要言語
C
スター
14k
フォーク
3k
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

nmap/nmap のほかの issue

nmap/nmap の issue をすべて見る

似ている issue

C の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。