From 71e3b36b17c3fb6247415ea065060bc73b43eace Mon Sep 17 00:00:00 2001 From: NG YUN SHING Date: Sun, 15 Nov 2026 23:52:28 +0800 Subject: [PATCH 01/32] Add isolated MariaDB CONNECT CWE-134 validation harness --- .../mariadb-connect-cwe134/README.md | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 security-research/mariadb-connect-cwe134/README.md diff --git a/security-research/mariadb-connect-cwe134/README.md b/security-research/mariadb-connect-cwe134/README.md new file mode 100644 index 000000000000..0a81037a7bc6 --- /dev/null +++ b/security-research/mariadb-connect-cwe134/README.md @@ -0,0 +1,38 @@ +# MariaDB CONNECT CWE-134 validation harness + +This directory is an isolated research harness. It does not modify Node.js runtime code. + +## Goal + +Validate the reported call path in a real MariaDB server with CONNECT loaded: + +`CREATE TABLE` options -> `GetStringOption()` -> `ha_connect::GetRealString()` -> `snprintf(sv, size, s, partname)`. + +The harness records server version, CONNECT availability, SQL output, process exit status, and server logs. It does **not** claim RCE, arbitrary write, or information disclosure. + +## Run locally + +Requirements: Docker Engine and Docker Compose v2. + +```sh +cd security-research/mariadb-connect-cwe134 +./run.sh +``` + +The runner creates a disposable MariaDB container, installs/loads CONNECT if the image package provides it, and runs one test case per fresh server container. A crashing server is recorded as a result rather than treated as a successful exploit. + +## Cases + +- `baseline`: partitioned CONNECT CSV table with a plain filename. +- `extra-s`: extra `%s` conversions; this is undefined behavior and may crash. +- `percent-n`: `%n` conversion; outcome depends on the actual libc/build hardening and argument interpretation. + +The SQL payloads are executed only against the disposable local container created by this harness. Do not point the script at a production server. + +## Important limitations + +- MariaDB image package names and CONNECT plugin availability vary by release and distribution. The Docker build intentionally fails visibly if the plugin package cannot be installed. +- This harness does not establish that the tested binary has the same compiler flags or libc as a vendor release. +- A process abort is evidence of a crash/DoS condition, not a memory disclosure or RCE. +- A successful `%n` test is not by itself proof of a controllable arbitrary write. The pointer value and write target must be independently established. +- GitHub Actions results are authoritative only for the exact image digest and logs recorded by that run. From c7a5bafad17acd14a310c8c666b1b3e002ec97af Mon Sep 17 00:00:00 2001 From: NG YUN SHING Date: Sun, 15 Nov 2026 23:52:31 +0800 Subject: [PATCH 02/32] Add disposable MariaDB CONNECT test image --- security-research/mariadb-connect-cwe134/Dockerfile | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 security-research/mariadb-connect-cwe134/Dockerfile diff --git a/security-research/mariadb-connect-cwe134/Dockerfile b/security-research/mariadb-connect-cwe134/Dockerfile new file mode 100644 index 000000000000..2c6be8fc7913 --- /dev/null +++ b/security-research/mariadb-connect-cwe134/Dockerfile @@ -0,0 +1,12 @@ +ARG MARIADB_IMAGE=mariadb:11.4 +FROM ${MARIADB_IMAGE} + +# CONNECT is packaged separately in some MariaDB distributions. +# Keep package installation explicit so CI fails rather than silently testing +# a server without the target storage engine. +RUN apt-get update \ + && (apt-get install -y --no-install-recommends mariadb-plugin-connect \ + || apt-get install -y --no-install-recommends mariadb-plugin-connect-dbgsym) \ + && rm -rf /var/lib/apt/lists/* + +COPY connect.cnf /etc/mysql/conf.d/connect.cnf From 5acb462bf786d62ba5adf14e578867d6983e5638 Mon Sep 17 00:00:00 2001 From: NG YUN SHING Date: Sun, 15 Nov 2026 23:52:33 +0800 Subject: [PATCH 03/32] Configure CONNECT plugin for isolated validation --- security-research/mariadb-connect-cwe134/connect.cnf | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 security-research/mariadb-connect-cwe134/connect.cnf diff --git a/security-research/mariadb-connect-cwe134/connect.cnf b/security-research/mariadb-connect-cwe134/connect.cnf new file mode 100644 index 000000000000..de1e1311962e --- /dev/null +++ b/security-research/mariadb-connect-cwe134/connect.cnf @@ -0,0 +1,2 @@ +[mariadbd] +plugin_load_add=ha_connect From 6e5305b8802c0db9b9170f366d786167cc49abfd Mon Sep 17 00:00:00 2001 From: NG YUN SHING Date: Sun, 15 Nov 2026 23:52:36 +0800 Subject: [PATCH 04/32] Add disposable MariaDB test services --- .../mariadb-connect-cwe134/compose.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 security-research/mariadb-connect-cwe134/compose.yaml diff --git a/security-research/mariadb-connect-cwe134/compose.yaml b/security-research/mariadb-connect-cwe134/compose.yaml new file mode 100644 index 000000000000..b0d76275d742 --- /dev/null +++ b/security-research/mariadb-connect-cwe134/compose.yaml @@ -0,0 +1,15 @@ +services: + mariadb-connect: + build: + context: . + args: + MARIADB_IMAGE: ${MARIADB_IMAGE:-mariadb:11.4} + environment: + MARIADB_ROOT_PASSWORD: test-only-password + healthcheck: + test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"] + interval: 3s + timeout: 3s + retries: 40 + tmpfs: + - /var/lib/mysql From 7ef24618d440dbfa634ac9ada538d0d9adbc3af1 Mon Sep 17 00:00:00 2001 From: NG YUN SHING Date: Sun, 15 Nov 2026 23:52:39 +0800 Subject: [PATCH 05/32] Add end-to-end CONNECT format-string test runner --- .../mariadb-connect-cwe134/run.sh | 81 +++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 security-research/mariadb-connect-cwe134/run.sh diff --git a/security-research/mariadb-connect-cwe134/run.sh b/security-research/mariadb-connect-cwe134/run.sh new file mode 100644 index 000000000000..3b067a0073e4 --- /dev/null +++ b/security-research/mariadb-connect-cwe134/run.sh @@ -0,0 +1,81 @@ +#!/usr/bin/env bash +set -Eeuo pipefail + +cd "$(dirname "$0")" +command -v docker >/dev/null || { echo "docker is required" >&2; exit 2; } +docker compose version >/dev/null + +image_tag="mariadb-connect-cwe134:local" +docker build --build-arg "MARIADB_IMAGE=${MARIADB_IMAGE:-mariadb:11.4}" -t "$image_tag" . + +run_case() { + local name="$1" + local filename="$2" + local container="connect-cwe134-${name}-$$" + local log_file="result-${name}.log" + local sql_file + sql_file="$(mktemp)" + cat >"$sql_file" </dev/null + + local ready=0 + for _ in $(seq 1 60); do + if docker exec "$container" mariadb-admin -uroot -ptest-only-password ping --silent >/dev/null 2>&1; then + ready=1 + break + fi + if ! docker inspect -f '{{.State.Running}}' "$container" 2>/dev/null | grep -q true; then + break + fi + sleep 2 + done + + if [[ "$ready" -ne 1 ]]; then + echo "Server did not become ready" | tee "$log_file" + docker logs "$container" >>"$log_file" 2>&1 || true + docker rm -f "$container" >/dev/null 2>&1 || true + rm -f "$sql_file" + return 0 + fi + + set +e + docker exec -i "$container" mariadb -uroot -ptest-only-password <"$sql_file" >"$log_file" 2>&1 + local sql_rc=$? + set -e + echo "sql_exit_code=$sql_rc" | tee -a "$log_file" + + sleep 2 + local running + running="$(docker inspect -f '{{.State.Running}}' "$container" 2>/dev/null || echo missing)" + echo "container_running_after_test=$running" | tee -a "$log_file" + docker logs "$container" >>"$log_file" 2>&1 || true + cat "$log_file" + + docker rm -f "$container" >/dev/null 2>&1 || true + rm -f "$sql_file" +} + +run_case baseline "ordinary.csv" +run_case extra-s "d_%s%s%s%s.csv" +run_case percent-n "d_%n.csv" + +echo "Completed. Inspect result-*.log; no exploitability claim is made by this harness." From 81e2e7446c77181147e811becae3fb124b80c328 Mon Sep 17 00:00:00 2001 From: NG YUN SHING Date: Sun, 15 Nov 2026 23:52:42 +0800 Subject: [PATCH 06/32] Add CI workflow for MariaDB CONNECT CWE-134 validation --- .github/workflows/mariadb-connect-cwe134.yml | 27 ++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/mariadb-connect-cwe134.yml diff --git a/.github/workflows/mariadb-connect-cwe134.yml b/.github/workflows/mariadb-connect-cwe134.yml new file mode 100644 index 000000000000..6d920a9d8674 --- /dev/null +++ b/.github/workflows/mariadb-connect-cwe134.yml @@ -0,0 +1,27 @@ +name: MariaDB CONNECT CWE-134 validation + +on: + workflow_dispatch: + push: + paths: + - "security-research/mariadb-connect-cwe134/**" + - ".github/workflows/mariadb-connect-cwe134.yml" + +jobs: + e2e: + runs-on: ubuntu-latest + timeout-minutes: 25 + steps: + - uses: actions/checkout@v4 + - name: Build and run isolated MariaDB tests + working-directory: security-research/mariadb-connect-cwe134 + run: | + chmod +x run.sh + ./run.sh + - name: Upload test logs + if: always() + uses: actions/upload-artifact@v4 + with: + name: mariadb-connect-cwe134-logs + path: security-research/mariadb-connect-cwe134/result-*.log + if-no-files-found: warn From c5f680f9114852f2d7bdcfbbc80eb2f9d290e69c Mon Sep 17 00:00:00 2001 From: NG YUN SHING Date: Sun, 15 Nov 2026 23:53:12 +0800 Subject: [PATCH 07/32] Make CONNECT package prerequisite explicit --- security-research/mariadb-connect-cwe134/Dockerfile | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/security-research/mariadb-connect-cwe134/Dockerfile b/security-research/mariadb-connect-cwe134/Dockerfile index 2c6be8fc7913..d59cd9a17adb 100644 --- a/security-research/mariadb-connect-cwe134/Dockerfile +++ b/security-research/mariadb-connect-cwe134/Dockerfile @@ -1,12 +1,9 @@ ARG MARIADB_IMAGE=mariadb:11.4 FROM ${MARIADB_IMAGE} -# CONNECT is packaged separately in some MariaDB distributions. -# Keep package installation explicit so CI fails rather than silently testing -# a server without the target storage engine. +# Fail clearly if this distribution does not package the CONNECT plugin here. RUN apt-get update \ - && (apt-get install -y --no-install-recommends mariadb-plugin-connect \ - || apt-get install -y --no-install-recommends mariadb-plugin-connect-dbgsym) \ + && apt-get install -y --no-install-recommends mariadb-plugin-connect \ && rm -rf /var/lib/apt/lists/* COPY connect.cnf /etc/mysql/conf.d/connect.cnf From 2f01ca35e12410f27adb5a040cae00574384e8b2 Mon Sep 17 00:00:00 2001 From: NG YUN SHING Date: Sun, 15 Nov 2026 23:53:14 +0800 Subject: [PATCH 08/32] Use preloaded CONNECT plugin in SQL probe --- security-research/mariadb-connect-cwe134/run.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/security-research/mariadb-connect-cwe134/run.sh b/security-research/mariadb-connect-cwe134/run.sh index 3b067a0073e4..c93d60c6c284 100644 --- a/security-research/mariadb-connect-cwe134/run.sh +++ b/security-research/mariadb-connect-cwe134/run.sh @@ -16,7 +16,6 @@ run_case() { local sql_file sql_file="$(mktemp)" cat >"$sql_file" < Date: Sun, 15 Nov 2026 23:53:16 +0800 Subject: [PATCH 09/32] Run validation workflow for pull requests --- .github/workflows/mariadb-connect-cwe134.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/mariadb-connect-cwe134.yml b/.github/workflows/mariadb-connect-cwe134.yml index 6d920a9d8674..47eaa4bdb339 100644 --- a/.github/workflows/mariadb-connect-cwe134.yml +++ b/.github/workflows/mariadb-connect-cwe134.yml @@ -2,6 +2,10 @@ name: MariaDB CONNECT CWE-134 validation on: workflow_dispatch: + pull_request: + paths: + - "security-research/mariadb-connect-cwe134/**" + - ".github/workflows/mariadb-connect-cwe134.yml" push: paths: - "security-research/mariadb-connect-cwe134/**" From 4e5c1518a3483bcad5daf1eb0c7353cdb20cd24c Mon Sep 17 00:00:00 2001 From: NG YUN SHING Date: Sun, 15 Nov 2026 23:53:19 +0800 Subject: [PATCH 10/32] Document shell invocation accurately --- security-research/mariadb-connect-cwe134/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security-research/mariadb-connect-cwe134/README.md b/security-research/mariadb-connect-cwe134/README.md index 0a81037a7bc6..fc1aeca9b17d 100644 --- a/security-research/mariadb-connect-cwe134/README.md +++ b/security-research/mariadb-connect-cwe134/README.md @@ -16,7 +16,7 @@ Requirements: Docker Engine and Docker Compose v2. ```sh cd security-research/mariadb-connect-cwe134 -./run.sh +bash run.sh ``` The runner creates a disposable MariaDB container, installs/loads CONNECT if the image package provides it, and runs one test case per fresh server container. A crashing server is recorded as a result rather than treated as a successful exploit. From bfd6e4fbcb2654e61070780e09914b924b4fcccc Mon Sep 17 00:00:00 2001 From: NG YUN SHING Date: Sun, 15 Nov 2026 23:57:16 +0800 Subject: [PATCH 11/32] Fix TCP readiness and make SQL failures fail CI --- .../mariadb-connect-cwe134/run.sh | 37 +++++++++++++++---- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/security-research/mariadb-connect-cwe134/run.sh b/security-research/mariadb-connect-cwe134/run.sh index c93d60c6c284..bf65946f1cdb 100644 --- a/security-research/mariadb-connect-cwe134/run.sh +++ b/security-research/mariadb-connect-cwe134/run.sh @@ -3,11 +3,12 @@ set -Eeuo pipefail cd "$(dirname "$0")" command -v docker >/dev/null || { echo "docker is required" >&2; exit 2; } -docker compose version >/dev/null image_tag="mariadb-connect-cwe134:local" docker build --build-arg "MARIADB_IMAGE=${MARIADB_IMAGE:-mariadb:11.4}" -t "$image_tag" . +failures=0 + run_case() { local name="$1" local filename="$2" @@ -16,6 +17,8 @@ run_case() { local sql_file sql_file="$(mktemp)" cat >"$sql_file" </dev/null local ready=0 - for _ in $(seq 1 60); do - if docker exec "$container" mariadb-admin -uroot -ptest-only-password ping --silent >/dev/null 2>&1; then + # The official image briefly starts a socket-only temporary server while + # initializing users. Require TCP readiness to avoid racing that phase. + for _ in $(seq 1 90); do + if docker exec "$container" mariadb-admin --protocol=tcp -h127.0.0.1 \ + -uroot -ptest-only-password ping --silent >/dev/null 2>&1; then ready=1 break fi @@ -49,15 +55,17 @@ SQL done if [[ "$ready" -ne 1 ]]; then - echo "Server did not become ready" | tee "$log_file" + echo "FAIL: MariaDB did not become TCP-ready" | tee "$log_file" docker logs "$container" >>"$log_file" 2>&1 || true docker rm -f "$container" >/dev/null 2>&1 || true rm -f "$sql_file" - return 0 + failures=$((failures + 1)) + return fi set +e - docker exec -i "$container" mariadb -uroot -ptest-only-password <"$sql_file" >"$log_file" 2>&1 + docker exec -i "$container" mariadb --protocol=tcp -h127.0.0.1 \ + -uroot -ptest-only-password --show-warnings <"$sql_file" >"$log_file" 2>&1 local sql_rc=$? set -e echo "sql_exit_code=$sql_rc" | tee -a "$log_file" @@ -69,6 +77,16 @@ SQL docker logs "$container" >>"$log_file" 2>&1 || true cat "$log_file" + if [[ "$sql_rc" -ne 0 ]]; then + echo "FAIL: SQL test did not complete for $name" >&2 + failures=$((failures + 1)) + elif ! grep -q $'1\tprobe' "$log_file"; then + echo "FAIL: expected row was not returned for $name" >&2 + failures=$((failures + 1)) + else + echo "PASS: SQL completed and returned expected row for $name" + fi + docker rm -f "$container" >/dev/null 2>&1 || true rm -f "$sql_file" } @@ -77,4 +95,9 @@ run_case baseline "ordinary.csv" run_case extra-s "d_%s%s%s%s.csv" run_case percent-n "d_%n.csv" -echo "Completed. Inspect result-*.log; no exploitability claim is made by this harness." +if [[ "$failures" -ne 0 ]]; then + echo "Validation harness had $failures failed case(s)." >&2 + exit 1 +fi + +echo "All SQL cases completed. This is not, by itself, proof of exploitability." From c2c548106205f42199ef109c8c5e4df8989fa570 Mon Sep 17 00:00:00 2001 From: NG YUN SHING Date: Sun, 15 Nov 2026 23:57:18 +0800 Subject: [PATCH 12/32] Document strict SQL validation and evidence limits --- .../mariadb-connect-cwe134/README.md | 30 ++++++++----------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/security-research/mariadb-connect-cwe134/README.md b/security-research/mariadb-connect-cwe134/README.md index fc1aeca9b17d..bac0118ae784 100644 --- a/security-research/mariadb-connect-cwe134/README.md +++ b/security-research/mariadb-connect-cwe134/README.md @@ -4,35 +4,31 @@ This directory is an isolated research harness. It does not modify Node.js runti ## Goal -Validate the reported call path in a real MariaDB server with CONNECT loaded: +Exercise a real MariaDB server with CONNECT loaded using partitioned CONNECT CSV tables. The suspected source-level call is: -`CREATE TABLE` options -> `GetStringOption()` -> `ha_connect::GetRealString()` -> `snprintf(sv, size, s, partname)`. +`snprintf(sv, size, s, partname)` -The harness records server version, CONNECT availability, SQL output, process exit status, and server logs. It does **not** claim RCE, arbitrary write, or information disclosure. +The harness runs a baseline filename, a filename containing extra `%s` conversions, and a `%n` filename. It records SQL output and server logs for each fresh container. ## Run locally -Requirements: Docker Engine and Docker Compose v2. +Requirements: Docker Engine. ```sh cd security-research/mariadb-connect-cwe134 bash run.sh ``` -The runner creates a disposable MariaDB container, installs/loads CONNECT if the image package provides it, and runs one test case per fresh server container. A crashing server is recorded as a result rather than treated as a successful exploit. +The runner waits for the final TCP listener (not the temporary socket-only initialization server), creates and selects a dedicated database, and requires each SQL case to complete and return the inserted row. A SQL failure or missing row fails the workflow. The containers are disposable and use a test-only root password. -## Cases +## Interpretation -- `baseline`: partitioned CONNECT CSV table with a plain filename. -- `extra-s`: extra `%s` conversions; this is undefined behavior and may crash. -- `percent-n`: `%n` conversion; outcome depends on the actual libc/build hardening and argument interpretation. +- A passing baseline confirms the test table syntax and CONNECT CSV path work on the tested image. +- A passing malformed-format case means only that this input completed on that exact build; it does not establish safety or exploitability. +- A crash/abort is evidence of availability impact, not RCE. +- A successful `%n` execution is not proof of a controllable arbitrary write. The actual pointer value, memory permissions, and write effect must be independently established. +- No RCE, arbitrary write, or information disclosure is claimed by this harness. -The SQL payloads are executed only against the disposable local container created by this harness. Do not point the script at a production server. +## Scope and limitations -## Important limitations - -- MariaDB image package names and CONNECT plugin availability vary by release and distribution. The Docker build intentionally fails visibly if the plugin package cannot be installed. -- This harness does not establish that the tested binary has the same compiler flags or libc as a vendor release. -- A process abort is evidence of a crash/DoS condition, not a memory disclosure or RCE. -- A successful `%n` test is not by itself proof of a controllable arbitrary write. The pointer value and write target must be independently established. -- GitHub Actions results are authoritative only for the exact image digest and logs recorded by that run. +The Docker image tag defaults to `mariadb:11.4`; set `MARIADB_IMAGE` to test another official image. The plugin package and binary hardening vary by release and distribution. Results apply only to the exact image digest recorded by the workflow. From f12b898ad2b31b1b1af1044f9dd0a03d9ae822f3 Mon Sep 17 00:00:00 2001 From: NG YUN SHING Date: Sun, 15 Nov 2026 23:59:06 +0800 Subject: [PATCH 13/32] Assert expected fortified %n abort as DoS evidence --- .../mariadb-connect-cwe134/run.sh | 36 +++++++++++-------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/security-research/mariadb-connect-cwe134/run.sh b/security-research/mariadb-connect-cwe134/run.sh index bf65946f1cdb..bd79772dd338 100644 --- a/security-research/mariadb-connect-cwe134/run.sh +++ b/security-research/mariadb-connect-cwe134/run.sh @@ -12,6 +12,7 @@ failures=0 run_case() { local name="$1" local filename="$2" + local expectation="$3" local container="connect-cwe134-${name}-$$" local log_file="result-${name}.log" local sql_file @@ -40,8 +41,6 @@ SQL "$image_tag" >/dev/null local ready=0 - # The official image briefly starts a socket-only temporary server while - # initializing users. Require TCP readiness to avoid racing that phase. for _ in $(seq 1 90); do if docker exec "$container" mariadb-admin --protocol=tcp -h127.0.0.1 \ -uroot -ptest-only-password ping --silent >/dev/null 2>&1; then @@ -68,36 +67,43 @@ SQL -uroot -ptest-only-password --show-warnings <"$sql_file" >"$log_file" 2>&1 local sql_rc=$? set -e - echo "sql_exit_code=$sql_rc" | tee -a "$log_file" sleep 2 local running running="$(docker inspect -f '{{.State.Running}}' "$container" 2>/dev/null || echo missing)" + echo "sql_exit_code=$sql_rc" | tee -a "$log_file" echo "container_running_after_test=$running" | tee -a "$log_file" docker logs "$container" >>"$log_file" 2>&1 || true cat "$log_file" - if [[ "$sql_rc" -ne 0 ]]; then - echo "FAIL: SQL test did not complete for $name" >&2 - failures=$((failures + 1)) - elif ! grep -q $'1\tprobe' "$log_file"; then - echo "FAIL: expected row was not returned for $name" >&2 - failures=$((failures + 1)) - else - echo "PASS: SQL completed and returned expected row for $name" + if [[ "$expectation" == "normal" ]]; then + if [[ "$sql_rc" -eq 0 ]] && grep -q $'1\tprobe' "$log_file" && [[ "$running" == "true" ]]; then + echo "PASS: SQL completed, returned expected row, server remained alive ($name)" + else + echo "FAIL: expected normal completion and live server ($name)" >&2 + failures=$((failures + 1)) + fi + elif [[ "$expectation" == "fortify-abort" ]]; then + if grep -Fq "*** %n in writable segment detected ***" "$log_file" && \ + grep -Fq "__snprintf_chk" "$log_file" && [[ "$running" == "false" ]]; then + echo "PASS: %n reached fortified snprintf and aborted the server ($name)" + else + echo "FAIL: expected fortified %n abort was not observed ($name)" >&2 + failures=$((failures + 1)) + fi fi docker rm -f "$container" >/dev/null 2>&1 || true rm -f "$sql_file" } -run_case baseline "ordinary.csv" -run_case extra-s "d_%s%s%s%s.csv" -run_case percent-n "d_%n.csv" +run_case baseline "ordinary.csv" normal +run_case extra-s "d_%s%s%s%s.csv" normal +run_case percent-n "d_%n.csv" fortify-abort if [[ "$failures" -ne 0 ]]; then echo "Validation harness had $failures failed case(s)." >&2 exit 1 fi -echo "All SQL cases completed. This is not, by itself, proof of exploitability." +echo "All expected outcomes observed. The %n case demonstrates a process abort, not RCE." From dc8e601e6a40eeb85512cd9b5d78871a49926bc3 Mon Sep 17 00:00:00 2001 From: NG YUN SHING Date: Sun, 15 Nov 2026 23:59:09 +0800 Subject: [PATCH 14/32] Record reproduced MariaDB CONNECT %n denial of service --- .../mariadb-connect-cwe134/README.md | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/security-research/mariadb-connect-cwe134/README.md b/security-research/mariadb-connect-cwe134/README.md index bac0118ae784..a84bfa288b70 100644 --- a/security-research/mariadb-connect-cwe134/README.md +++ b/security-research/mariadb-connect-cwe134/README.md @@ -2,13 +2,17 @@ This directory is an isolated research harness. It does not modify Node.js runtime code. -## Goal +## Reproduced result -Exercise a real MariaDB server with CONNECT loaded using partitioned CONNECT CSV tables. The suspected source-level call is: +On the GitHub Actions image tested on 2026-11-15: -`snprintf(sv, size, s, partname)` +- MariaDB: `11.4.13-MariaDB-ubu2404` +- CONNECT plugin: `1.07.0002`, status `ACTIVE` +- Baseline partitioned CONNECT CSV table: succeeds and returns the inserted row. +- Filename with extra `%s` conversions: CREATE/INSERT/SELECT completes; CONNECT emits a warning for the derived partition filename. No crash was observed. +- Filename containing `%n`: MariaDB prints `*** %n in writable segment detected ***`, aborts with signal 6, and the backtrace includes libc `__snprintf_chk` called from `ha_connect.so`. -The harness runs a baseline filename, a filename containing extra `%s` conversions, and a `%n` filename. It records SQL output and server logs for each fresh container. +The last case is a reproducible server-process denial of service on this tested build. It also confirms that the format string reaches a fortified snprintf path. The abort is caused by glibc fortification rejecting `%n`; this test does **not** show an arbitrary write or RCE. ## Run locally @@ -19,16 +23,14 @@ cd security-research/mariadb-connect-cwe134 bash run.sh ``` -The runner waits for the final TCP listener (not the temporary socket-only initialization server), creates and selects a dedicated database, and requires each SQL case to complete and return the inserted row. A SQL failure or missing row fails the workflow. The containers are disposable and use a test-only root password. +The runner waits for the final TCP listener (not the temporary socket-only initialization server), creates and selects a dedicated database, and asserts the baseline and extra-`%s` cases complete. For `%n`, it asserts the expected fortified abort signature and stopped server. Each test uses a disposable container and a test-only root password. -## Interpretation +## Security interpretation -- A passing baseline confirms the test table syntax and CONNECT CSV path work on the tested image. -- A passing malformed-format case means only that this input completed on that exact build; it does not establish safety or exploitability. -- A crash/abort is evidence of availability impact, not RCE. -- A successful `%n` execution is not proof of a controllable arbitrary write. The actual pointer value, memory permissions, and write effect must be independently established. -- No RCE, arbitrary write, or information disclosure is claimed by this harness. +- Confirmed: SQL-controlled CONNECT `FILE_NAME` containing `%n` reaches `__snprintf_chk` through `ha_connect.so` and terminates the MariaDB server on the tested build. +- Impact demonstrated: database server process crash / denial of service. +- Not demonstrated: arbitrary memory write, information disclosure, code execution, privilege escalation, or unauthenticated remote reachability. +- The test uses a privileged local database connection to create a partitioned CONNECT table. Exploitability depends on whether an attacker can obtain the required SQL privileges in a target deployment. +- A crash in this fortified build is not proof that all MariaDB builds behave identically. Results apply only to the exact image digest and binary tested. -## Scope and limitations - -The Docker image tag defaults to `mariadb:11.4`; set `MARIADB_IMAGE` to test another official image. The plugin package and binary hardening vary by release and distribution. Results apply only to the exact image digest recorded by the workflow. +The suspected source-level defect is a user-controlled format string passed as the format argument to `snprintf`. The safe implementation should use a constant format string (for example, `"%s"`) and pass the user-controlled value only as data, after reviewing the intended formatting behavior. From 7f5318ecfa3ee34f5166a6bad7121d24065e1c5c Mon Sep 17 00:00:00 2001 From: NG YUN SHING Date: Mon, 16 Nov 2026 00:05:57 +0800 Subject: [PATCH 15/32] Document MariaDB upstream confirmation of CONNECT format-string flaw --- security-research/mariadb-connect-cwe134/README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/security-research/mariadb-connect-cwe134/README.md b/security-research/mariadb-connect-cwe134/README.md index a84bfa288b70..59af3a86b2c4 100644 --- a/security-research/mariadb-connect-cwe134/README.md +++ b/security-research/mariadb-connect-cwe134/README.md @@ -14,6 +14,14 @@ On the GitHub Actions image tested on 2026-11-15: The last case is a reproducible server-process denial of service on this tested build. It also confirms that the format string reaches a fortified snprintf path. The abort is caused by glibc fortification rejecting `%n`; this test does **not** show an arbitrary write or RCE. +## Independent upstream confirmation + +MariaDB upstream subsequently committed [b01a176de5d4c814333fead0c85e431666e00fee](https://github.com/MariaDB/server/commit/b01a176de5d4c814333fead0c85e431666e00fee), titled: + +`MDEV-41946 CONNECT: table option value used as printf format string, crash in ha_connect::GetRealString` + +The commit message explicitly states that, for partitioned tables, `GetRealString()` and `FileExists()` passed option values as the `snprintf()` format string while substituting the partition name. The fix substitutes only the first literal `%s` and copies the remainder literally. The same commit adds an upstream regression test using `FILE_NAME='P[%p-%d-%n-%%]-%s-%s.csv'` and verifies the literal format tokens survive in generated filenames. This independently confirms the root cause and the affected code path; it does not establish arbitrary-write or RCE impact. + ## Run locally Requirements: Docker Engine. @@ -28,9 +36,10 @@ The runner waits for the final TCP listener (not the temporary socket-only initi ## Security interpretation - Confirmed: SQL-controlled CONNECT `FILE_NAME` containing `%n` reaches `__snprintf_chk` through `ha_connect.so` and terminates the MariaDB server on the tested build. +- Independently confirmed by MariaDB upstream: the partition-name substitution passed table-option data as a printf format string; upstream fixed `GetRealString()` and `FileExists()` and added a regression test. - Impact demonstrated: database server process crash / denial of service. - Not demonstrated: arbitrary memory write, information disclosure, code execution, privilege escalation, or unauthenticated remote reachability. - The test uses a privileged local database connection to create a partitioned CONNECT table. Exploitability depends on whether an attacker can obtain the required SQL privileges in a target deployment. - A crash in this fortified build is not proof that all MariaDB builds behave identically. Results apply only to the exact image digest and binary tested. -The suspected source-level defect is a user-controlled format string passed as the format argument to `snprintf`. The safe implementation should use a constant format string (for example, `"%s"`) and pass the user-controlled value only as data, after reviewing the intended formatting behavior. +The safe implementation uses a constant format string and treats user-controlled option data literally, while preserving the intended first-`%s` partition substitution. From 73fa4cb5d66353bfb88fe96c96780cd07fca6448 Mon Sep 17 00:00:00 2001 From: NG YUN SHING Date: Mon, 16 Nov 2026 00:08:20 +0800 Subject: [PATCH 16/32] Document RCE assessment and fixed partname write target --- .../mariadb-connect-cwe134/README.md | 25 ++++++++++++++----- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/security-research/mariadb-connect-cwe134/README.md b/security-research/mariadb-connect-cwe134/README.md index 59af3a86b2c4..c51d230bfcdf 100644 --- a/security-research/mariadb-connect-cwe134/README.md +++ b/security-research/mariadb-connect-cwe134/README.md @@ -12,15 +12,28 @@ On the GitHub Actions image tested on 2026-11-15: - Filename with extra `%s` conversions: CREATE/INSERT/SELECT completes; CONNECT emits a warning for the derived partition filename. No crash was observed. - Filename containing `%n`: MariaDB prints `*** %n in writable segment detected ***`, aborts with signal 6, and the backtrace includes libc `__snprintf_chk` called from `ha_connect.so`. -The last case is a reproducible server-process denial of service on this tested build. It also confirms that the format string reaches a fortified snprintf path. The abort is caused by glibc fortification rejecting `%n`; this test does **not** show an arbitrary write or RCE. +The last case is a reproducible server-process denial of service on this tested build. The abort is caused by glibc fortification rejecting `%n`; this test does **not** show an arbitrary write or RCE. ## Independent upstream confirmation -MariaDB upstream subsequently committed [b01a176de5d4c814333fead0c85e431666e00fee](https://github.com/MariaDB/server/commit/b01a176de5d4c814333fead0c85e431666e00fee), titled: +MariaDB upstream committed [b01a176de5d4c814333fead0c85e431666e00fee](https://github.com/MariaDB/server/commit/b01a176de5d4c814333fead0c85e431666e00fee), titled: `MDEV-41946 CONNECT: table option value used as printf format string, crash in ha_connect::GetRealString` -The commit message explicitly states that, for partitioned tables, `GetRealString()` and `FileExists()` passed option values as the `snprintf()` format string while substituting the partition name. The fix substitutes only the first literal `%s` and copies the remainder literally. The same commit adds an upstream regression test using `FILE_NAME='P[%p-%d-%n-%%]-%s-%s.csv'` and verifies the literal format tokens survive in generated filenames. This independently confirms the root cause and the affected code path; it does not establish arbitrary-write or RCE impact. +The commit message explicitly states that, for partitioned tables, `GetRealString()` and `FileExists()` passed option values as the `snprintf()` format string while substituting the partition name. The fix substitutes only the first literal `%s` and copies the remainder literally. The commit adds an upstream regression test using format tokens such as `%p`, `%d`, `%n`, and `%%`. This independently confirms the root cause and affected code path; it does not establish RCE. + +## RCE assessment + +A source-level review of the vulnerable call is important to avoid overstating impact: + +- `GetRealString()` calls `snprintf(sv, size, s, partname)`: the attacker-controlled option supplies the format string, but the call supplies only one explicit variadic argument. +- In `ha_connect.h`, `partname` is an in-object `char partname[65]` buffer; `GetPartName()` returns that same buffer for partitioned tables. +- Consequently, a plain `%n` at the first conversion uses the supplied `partname` pointer as its destination. That is a fixed internal buffer, not an attacker-selected pointer. Other conversions that request additional arguments read arguments that were not supplied, which is undefined behavior but is not, by itself, proof of a controllable instruction pointer or RCE. +- The tested fortified build aborts on `%n` before a write occurs. + +No controlled instruction pointer, executable memory, command execution, arbitrary-address write, or end-to-end RCE has been demonstrated for this specific MDEV-41946 path. RCE must therefore be treated as **unproven**, not as an established impact. A successful crash test and the upstream fix do not change that conclusion. + +Do not conflate this finding with the older [CVE-2022-24051 / ZDI-22-318](https://www.zerodayinitiative.com/advisories/ZDI-22-318/), which is separately described by ZDI as a CONNECT format-string privilege-escalation issue with arbitrary code execution. That historical advisory does not prove that MDEV-41946 shares its exploit primitive or is exploitable in the same way. ## Run locally @@ -35,11 +48,11 @@ The runner waits for the final TCP listener (not the temporary socket-only initi ## Security interpretation -- Confirmed: SQL-controlled CONNECT `FILE_NAME` containing `%n` reaches `__snprintf_chk` through `ha_connect.so` and terminates the MariaDB server on the tested build. -- Independently confirmed by MariaDB upstream: the partition-name substitution passed table-option data as a printf format string; upstream fixed `GetRealString()` and `FileExists()` and added a regression test. +- Confirmed: SQL-controlled CONNECT `FILE_NAME` containing `%n` reaches `__snprintf_chk` through `ha_connect.so` and terminates MariaDB on the tested fortified build. +- Independently confirmed by MariaDB upstream: partition-name substitution passed table-option data as a printf format string; upstream fixed `GetRealString()` and `FileExists()` and added a regression test. - Impact demonstrated: database server process crash / denial of service. - Not demonstrated: arbitrary memory write, information disclosure, code execution, privilege escalation, or unauthenticated remote reachability. - The test uses a privileged local database connection to create a partitioned CONNECT table. Exploitability depends on whether an attacker can obtain the required SQL privileges in a target deployment. -- A crash in this fortified build is not proof that all MariaDB builds behave identically. Results apply only to the exact image digest and binary tested. +- Results apply only to the tested image and build configuration. The safe implementation uses a constant format string and treats user-controlled option data literally, while preserving the intended first-`%s` partition substitution. From c2e27b250345ae989db091423c809de6aca23b31 Mon Sep 17 00:00:00 2001 From: NG YUN SHING Date: Mon, 16 Nov 2026 00:14:30 +0800 Subject: [PATCH 17/32] Add isolated snprintf variadic-slot probe for CONNECT path --- .../mariadb-connect-cwe134/format_probe.c | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 security-research/mariadb-connect-cwe134/format_probe.c diff --git a/security-research/mariadb-connect-cwe134/format_probe.c b/security-research/mariadb-connect-cwe134/format_probe.c new file mode 100644 index 000000000000..b7342a1c7cfa --- /dev/null +++ b/security-research/mariadb-connect-cwe134/format_probe.c @@ -0,0 +1,71 @@ +#define _GNU_SOURCE +#include +#include +#include +#include +#include +#include + +typedef int (*vsnprintf_chk_fn)(char *, size_t, int, size_t, + const char *, va_list); +static vsnprintf_chk_fn real_vsnprintf_chk; + +static size_t append_text(char *dst, size_t pos, const char *src) { + while (*src && pos < 1900) dst[pos++] = *src++; + return pos; +} +static size_t append_hex(char *dst, size_t pos, uintptr_t value) { + static const char digits[] = "0123456789abcdef"; + char tmp[2 * sizeof(value)]; + size_t n = 0; + do { tmp[n++] = digits[value & 0xf]; value >>= 4; } while (value && n < sizeof(tmp)); + if (pos < 1900) dst[pos++] = '0'; + if (pos < 1900) dst[pos++] = 'x'; + while (n && pos < 1900) dst[pos++] = tmp[--n]; + return pos; +} + +__attribute__((constructor)) +static void init_real_vsnprintf_chk(void) { + real_vsnprintf_chk = (vsnprintf_chk_fn)dlsym(RTLD_NEXT, "__vsnprintf_chk"); +} + +/* + * Probe only a filename deliberately prefixed with PROBE_. For that one + * controlled test string, log the raw variadic slots and call plain vsnprintf + * so the fortified %n guard does not mask the argument-layout observation. + * All ordinary strings retain the system __vsnprintf_chk behaviour. + */ +int __snprintf_chk(char *dst, size_t maxlen, int flag, size_t objsize, + const char *format, ...) { + va_list ap; + va_start(ap, format); + if (format && strncmp(format, "PROBE_", 6) == 0) { + va_list scan; + char line[2048]; + size_t pos = 0; + va_copy(scan, ap); + pos = append_text(line, pos, "CONNECT_FMT_PROBE"); + for (unsigned i = 1; i <= 12; ++i) { + uintptr_t value = va_arg(scan, uintptr_t); + pos = append_text(line, pos, " arg"); + pos = append_hex(line, pos, i); + if (pos < sizeof(line)) line[pos++] = '='; + pos = append_hex(line, pos, value); + } + if (pos < sizeof(line)) line[pos++] = '\n'; + (void)write(STDERR_FILENO, line, pos); + va_end(scan); + int result = vsnprintf(dst, maxlen, format, ap); + va_end(ap); + return result; + } + if (real_vsnprintf_chk) { + int result = real_vsnprintf_chk(dst, maxlen, flag, objsize, format, ap); + va_end(ap); + return result; + } + int result = vsnprintf(dst, maxlen, format, ap); + va_end(ap); + return result; +} From dc4872f05a74d3ec7a6b60bf3d0b528f9a75ef62 Mon Sep 17 00:00:00 2001 From: NG YUN SHING Date: Mon, 16 Nov 2026 00:14:46 +0800 Subject: [PATCH 18/32] Build test-only variadic argument probe into MariaDB test image --- security-research/mariadb-connect-cwe134/Dockerfile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/security-research/mariadb-connect-cwe134/Dockerfile b/security-research/mariadb-connect-cwe134/Dockerfile index d59cd9a17adb..2eeb29465c66 100644 --- a/security-research/mariadb-connect-cwe134/Dockerfile +++ b/security-research/mariadb-connect-cwe134/Dockerfile @@ -1,9 +1,12 @@ ARG MARIADB_IMAGE=mariadb:11.4 FROM ${MARIADB_IMAGE} -# Fail clearly if this distribution does not package the CONNECT plugin here. +# Install CONNECT and a tiny, test-only ABI probe for the vulnerable call. RUN apt-get update \ - && apt-get install -y --no-install-recommends mariadb-plugin-connect \ + && apt-get install -y --no-install-recommends mariadb-plugin-connect gcc libc6-dev \ && rm -rf /var/lib/apt/lists/* COPY connect.cnf /etc/mysql/conf.d/connect.cnf +COPY format_probe.c /tmp/format_probe.c +RUN gcc -shared -fPIC -O2 -o /usr/local/lib/libconnect_fmt_probe.so /tmp/format_probe.c -ldl \ + && rm -f /tmp/format_probe.c From 03c06940d04e44efa21af8e29b6a032359edec76 Mon Sep 17 00:00:00 2001 From: NG YUN SHING Date: Mon, 16 Nov 2026 00:15:06 +0800 Subject: [PATCH 19/32] Add actual MariaDB variadic-slot probe case to E2E runner --- .../mariadb-connect-cwe134/run.sh | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/security-research/mariadb-connect-cwe134/run.sh b/security-research/mariadb-connect-cwe134/run.sh index bd79772dd338..8d17cee55f07 100644 --- a/security-research/mariadb-connect-cwe134/run.sh +++ b/security-research/mariadb-connect-cwe134/run.sh @@ -38,6 +38,7 @@ SQL echo "===== case: $name =====" docker run -d --name "$container" \ -e MARIADB_ROOT_PASSWORD=test-only-password \ + -e LD_PRELOAD=/usr/local/lib/libconnect_fmt_probe.so \ "$image_tag" >/dev/null local ready=0 @@ -83,6 +84,39 @@ SQL echo "FAIL: expected normal completion and live server ($name)" >&2 failures=$((failures + 1)) fi + elif [[ "$expectation" == "arg-probe" ]]; then + if [[ "$sql_rc" -eq 0 ]] && grep -q + if grep -Fq "*** %n in writable segment detected ***" "$log_file" && \ + grep -Fq "__snprintf_chk" "$log_file" && [[ "$running" == "false" ]]; then + echo "PASS: %n reached fortified snprintf and aborted the server ($name)" + else + echo "FAIL: expected fortified %n abort was not observed ($name)" >&2 + failures=$((failures + 1)) + fi + fi + + docker rm -f "$container" >/dev/null 2>&1 || true + rm -f "$sql_file" +} + +run_case baseline "ordinary.csv" normal +run_case extra-s "d_%s%s%s%s.csv" normal +run_case arg-probe "PROBE_%1$p_%2$p_%3$p_%4$p_%5$p_%6$p_%7$p_%8$p_%9$p_%10$p_%11$p_%12$p.csv" arg-probe +run_case percent-n "d_%n.csv" fortify-abort + +if [[ "$failures" -ne 0 ]]; then + echo "Validation harness had $failures failed case(s)." >&2 + exit 1 +fi + +echo "All expected outcomes observed. The %n case demonstrates a process abort, not RCE." +1\tprobe' "$log_file" && \ + grep -Fq "CONNECT_FMT_PROBE" "$log_file" && [[ "$running" == "true" ]]; then + echo "PASS: captured real MariaDB CONNECT variadic argument slots ($name)" + else + echo "FAIL: expected variadic argument probe result ($name)" >&2 + failures=$((failures + 1)) + fi elif [[ "$expectation" == "fortify-abort" ]]; then if grep -Fq "*** %n in writable segment detected ***" "$log_file" && \ grep -Fq "__snprintf_chk" "$log_file" && [[ "$running" == "false" ]]; then From 5c519028f3dee423a6e58cf8a4bc9df698b1a30f Mon Sep 17 00:00:00 2001 From: NG YUN SHING Date: Mon, 16 Nov 2026 00:15:39 +0800 Subject: [PATCH 20/32] Fix runner and add real CONNECT argument-slot probe case --- .../mariadb-connect-cwe134/run.sh | 30 ++----------------- 1 file changed, 3 insertions(+), 27 deletions(-) diff --git a/security-research/mariadb-connect-cwe134/run.sh b/security-research/mariadb-connect-cwe134/run.sh index 8d17cee55f07..b98e9228f602 100644 --- a/security-research/mariadb-connect-cwe134/run.sh +++ b/security-research/mariadb-connect-cwe134/run.sh @@ -85,32 +85,7 @@ SQL failures=$((failures + 1)) fi elif [[ "$expectation" == "arg-probe" ]]; then - if [[ "$sql_rc" -eq 0 ]] && grep -q - if grep -Fq "*** %n in writable segment detected ***" "$log_file" && \ - grep -Fq "__snprintf_chk" "$log_file" && [[ "$running" == "false" ]]; then - echo "PASS: %n reached fortified snprintf and aborted the server ($name)" - else - echo "FAIL: expected fortified %n abort was not observed ($name)" >&2 - failures=$((failures + 1)) - fi - fi - - docker rm -f "$container" >/dev/null 2>&1 || true - rm -f "$sql_file" -} - -run_case baseline "ordinary.csv" normal -run_case extra-s "d_%s%s%s%s.csv" normal -run_case arg-probe "PROBE_%1$p_%2$p_%3$p_%4$p_%5$p_%6$p_%7$p_%8$p_%9$p_%10$p_%11$p_%12$p.csv" arg-probe -run_case percent-n "d_%n.csv" fortify-abort - -if [[ "$failures" -ne 0 ]]; then - echo "Validation harness had $failures failed case(s)." >&2 - exit 1 -fi - -echo "All expected outcomes observed. The %n case demonstrates a process abort, not RCE." -1\tprobe' "$log_file" && \ + if [[ "$sql_rc" -eq 0 ]] && grep -q $'1\tprobe' "$log_file" && \ grep -Fq "CONNECT_FMT_PROBE" "$log_file" && [[ "$running" == "true" ]]; then echo "PASS: captured real MariaDB CONNECT variadic argument slots ($name)" else @@ -133,6 +108,7 @@ echo "All expected outcomes observed. The %n case demonstrates a process abort, run_case baseline "ordinary.csv" normal run_case extra-s "d_%s%s%s%s.csv" normal +run_case arg-probe "PROBE_%1$p_%2$p_%3$p_%4$p_%5$p_%6$p_%7$p_%8$p_%9$p_%10$p_%11$p_%12$p.csv" arg-probe run_case percent-n "d_%n.csv" fortify-abort if [[ "$failures" -ne 0 ]]; then @@ -140,4 +116,4 @@ if [[ "$failures" -ne 0 ]]; then exit 1 fi -echo "All expected outcomes observed. The %n case demonstrates a process abort, not RCE." +echo "All expected outcomes observed. The probe reports raw slots; it does not claim RCE." From 190c9bcb8459bb721eaa5f32ac94743e8857cacb Mon Sep 17 00:00:00 2001 From: NG YUN SHING Date: Mon, 16 Nov 2026 00:17:29 +0800 Subject: [PATCH 21/32] Quote percent positional probe string to prevent shell expansion --- security-research/mariadb-connect-cwe134/run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security-research/mariadb-connect-cwe134/run.sh b/security-research/mariadb-connect-cwe134/run.sh index b98e9228f602..6d7090b43f58 100644 --- a/security-research/mariadb-connect-cwe134/run.sh +++ b/security-research/mariadb-connect-cwe134/run.sh @@ -108,7 +108,7 @@ SQL run_case baseline "ordinary.csv" normal run_case extra-s "d_%s%s%s%s.csv" normal -run_case arg-probe "PROBE_%1$p_%2$p_%3$p_%4$p_%5$p_%6$p_%7$p_%8$p_%9$p_%10$p_%11$p_%12$p.csv" arg-probe +run_case arg-probe 'PROBE_%1$p_%2$p_%3$p_%4$p_%5$p_%6$p_%7$p_%8$p_%9$p_%10$p_%11$p_%12$p.csv' arg-probe run_case percent-n "d_%n.csv" fortify-abort if [[ "$failures" -ne 0 ]]; then From 8f01d65ec73100f91e028d1454ab3072d7bc8cb9 Mon Sep 17 00:00:00 2001 From: NG YUN SHING Date: Mon, 16 Nov 2026 00:19:56 +0800 Subject: [PATCH 22/32] Log memory mappings for MariaDB format-string variadic slots --- .../mariadb-connect-cwe134/format_probe.c | 60 +++++++++++++++---- 1 file changed, 49 insertions(+), 11 deletions(-) diff --git a/security-research/mariadb-connect-cwe134/format_probe.c b/security-research/mariadb-connect-cwe134/format_probe.c index b7342a1c7cfa..3804ae39f1b7 100644 --- a/security-research/mariadb-connect-cwe134/format_probe.c +++ b/security-research/mariadb-connect-cwe134/format_probe.c @@ -3,8 +3,10 @@ #include #include #include +#include #include #include +#include typedef int (*vsnprintf_chk_fn)(char *, size_t, int, size_t, const char *, va_list); @@ -24,38 +26,74 @@ static size_t append_hex(char *dst, size_t pos, uintptr_t value) { while (n && pos < 1900) dst[pos++] = tmp[--n]; return pos; } +static void emit_map_for(uintptr_t value, unsigned index) { + FILE *fp = fopen("/proc/self/maps", "r"); + if (!fp) return; + char line[1024]; + while (fgets(line, sizeof(line), fp)) { + unsigned long lo = 0, hi = 0; + if (sscanf(line, "%lx-%lx", &lo, &hi) == 2 && + value >= lo && value < hi) { + char out[1200]; + int n = snprintf(out, sizeof(out), "CONNECT_MAP arg%u=%s", index, line); + if (n > 0) (void)write(STDERR_FILENO, out, (size_t)n); + if (strstr(line, "[stack]")) { + int mem = open("/proc/self/mem", O_RDONLY); + if (mem >= 0) { + unsigned char bytes[128]; + uintptr_t start = value >= lo + 64 ? value - 64 : lo; + ssize_t got = pread(mem, bytes, sizeof(bytes), (off_t)start); + if (got > 0) { + size_t pos = 0; + pos = append_text(out, 0, "CONNECT_STACK_DUMP addr="); + pos = append_hex(out, pos, start); + pos = append_text(out, pos, " bytes="); + static const char hx[] = "0123456789abcdef"; + for (ssize_t i = 0; i < got && pos + 2 < sizeof(out); ++i) { + out[pos++] = hx[bytes[i] >> 4]; + out[pos++] = hx[bytes[i] & 15]; + } + out[pos++] = '\n'; + (void)write(STDERR_FILENO, out, pos); + } + close(mem); + } + } + break; + } + } + fclose(fp); +} __attribute__((constructor)) static void init_real_vsnprintf_chk(void) { real_vsnprintf_chk = (vsnprintf_chk_fn)dlsym(RTLD_NEXT, "__vsnprintf_chk"); } -/* - * Probe only a filename deliberately prefixed with PROBE_. For that one - * controlled test string, log the raw variadic slots and call plain vsnprintf - * so the fortified %n guard does not mask the argument-layout observation. - * All ordinary strings retain the system __vsnprintf_chk behaviour. - */ int __snprintf_chk(char *dst, size_t maxlen, int flag, size_t objsize, const char *format, ...) { va_list ap; va_start(ap, format); if (format && strncmp(format, "PROBE_", 6) == 0) { va_list scan; + uintptr_t values[12] = {0}; char line[2048]; size_t pos = 0; va_copy(scan, ap); pos = append_text(line, pos, "CONNECT_FMT_PROBE"); - for (unsigned i = 1; i <= 12; ++i) { - uintptr_t value = va_arg(scan, uintptr_t); + for (unsigned i = 0; i < 12; ++i) { + values[i] = va_arg(scan, uintptr_t); pos = append_text(line, pos, " arg"); - pos = append_hex(line, pos, i); - if (pos < sizeof(line)) line[pos++] = '='; - pos = append_hex(line, pos, value); + char number[24]; + int n = snprintf(number, sizeof(number), "%u=", i + 1); + if (n > 0) pos = append_text(line, pos, number); + pos = append_hex(line, pos, values[i]); } if (pos < sizeof(line)) line[pos++] = '\n'; (void)write(STDERR_FILENO, line, pos); va_end(scan); + for (unsigned i = 0; i < 12; ++i) + if (values[i]) emit_map_for(values[i], i + 1); int result = vsnprintf(dst, maxlen, format, ap); va_end(ap); return result; From edd5ed782c56f6b72d82eeadb69a1f8e6fbd3bde Mon Sep 17 00:00:00 2001 From: NG YUN SHING Date: Mon, 16 Nov 2026 00:20:03 +0800 Subject: [PATCH 23/32] Fix argument-slot probe assertion to validate emitted pointer map data --- security-research/mariadb-connect-cwe134/run.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/security-research/mariadb-connect-cwe134/run.sh b/security-research/mariadb-connect-cwe134/run.sh index 6d7090b43f58..9d0eb13ba93f 100644 --- a/security-research/mariadb-connect-cwe134/run.sh +++ b/security-research/mariadb-connect-cwe134/run.sh @@ -85,8 +85,7 @@ SQL failures=$((failures + 1)) fi elif [[ "$expectation" == "arg-probe" ]]; then - if [[ "$sql_rc" -eq 0 ]] && grep -q $'1\tprobe' "$log_file" && \ - grep -Fq "CONNECT_FMT_PROBE" "$log_file" && [[ "$running" == "true" ]]; then + if grep -Fq "CONNECT_FMT_PROBE" "$log_file" && [[ "$running" == "true" ]]; then echo "PASS: captured real MariaDB CONNECT variadic argument slots ($name)" else echo "FAIL: expected variadic argument probe result ($name)" >&2 From 2b48e156a188d0ac746e30263fc3d69b74ef3b28 Mon Sep 17 00:00:00 2001 From: NG YUN SHING Date: Mon, 16 Nov 2026 00:22:25 +0800 Subject: [PATCH 24/32] Dump memory around writable variadic pointer targets in isolated probe --- .../mariadb-connect-cwe134/format_probe.c | 60 ++++++++++--------- 1 file changed, 33 insertions(+), 27 deletions(-) diff --git a/security-research/mariadb-connect-cwe134/format_probe.c b/security-research/mariadb-connect-cwe134/format_probe.c index 3804ae39f1b7..d745f0905a64 100644 --- a/security-research/mariadb-connect-cwe134/format_probe.c +++ b/security-research/mariadb-connect-cwe134/format_probe.c @@ -26,43 +26,49 @@ static size_t append_hex(char *dst, size_t pos, uintptr_t value) { while (n && pos < 1900) dst[pos++] = tmp[--n]; return pos; } -static void emit_map_for(uintptr_t value, unsigned index) { +static void emit_map_and_memory(uintptr_t value, unsigned index) { FILE *fp = fopen("/proc/self/maps", "r"); if (!fp) return; char line[1024]; + int writable = 0; + unsigned long lo = 0, hi = 0; while (fgets(line, sizeof(line), fp)) { - unsigned long lo = 0, hi = 0; - if (sscanf(line, "%lx-%lx", &lo, &hi) == 2 && - value >= lo && value < hi) { + unsigned long a = 0, b = 0; + if (sscanf(line, "%lx-%lx", &a, &b) == 2 && value >= a && value < b) { + lo = a; hi = b; writable = line[18] == 'w'; char out[1200]; int n = snprintf(out, sizeof(out), "CONNECT_MAP arg%u=%s", index, line); if (n > 0) (void)write(STDERR_FILENO, out, (size_t)n); - if (strstr(line, "[stack]")) { - int mem = open("/proc/self/mem", O_RDONLY); - if (mem >= 0) { - unsigned char bytes[128]; - uintptr_t start = value >= lo + 64 ? value - 64 : lo; - ssize_t got = pread(mem, bytes, sizeof(bytes), (off_t)start); - if (got > 0) { - size_t pos = 0; - pos = append_text(out, 0, "CONNECT_STACK_DUMP addr="); - pos = append_hex(out, pos, start); - pos = append_text(out, pos, " bytes="); - static const char hx[] = "0123456789abcdef"; - for (ssize_t i = 0; i < got && pos + 2 < sizeof(out); ++i) { - out[pos++] = hx[bytes[i] >> 4]; - out[pos++] = hx[bytes[i] & 15]; - } - out[pos++] = '\n'; - (void)write(STDERR_FILENO, out, pos); - } - close(mem); - } - } break; } } fclose(fp); + if (!writable) return; + int mem = open("/proc/self/mem", O_RDONLY); + if (mem < 0) return; + unsigned char bytes[96]; + uintptr_t start = value >= lo + 32 ? value - 32 : lo; + size_t want = sizeof(bytes); + if (start + want > hi) want = hi - start; + ssize_t got = pread(mem, bytes, want, (off_t)start); + if (got > 0) { + char out[1200]; + size_t pos = 0; + pos = append_text(out, pos, "CONNECT_MEM arg"); + char number[24]; + int n = snprintf(number, sizeof(number), "%u addr=", index); + if (n > 0) pos = append_text(out, pos, number); + pos = append_hex(out, pos, start); + pos = append_text(out, pos, " bytes="); + static const char hx[] = "0123456789abcdef"; + for (ssize_t i = 0; i < got && pos + 2 < sizeof(out); ++i) { + out[pos++] = hx[bytes[i] >> 4]; + out[pos++] = hx[bytes[i] & 15]; + } + out[pos++] = '\n'; + (void)write(STDERR_FILENO, out, pos); + } + close(mem); } __attribute__((constructor)) @@ -93,7 +99,7 @@ int __snprintf_chk(char *dst, size_t maxlen, int flag, size_t objsize, (void)write(STDERR_FILENO, line, pos); va_end(scan); for (unsigned i = 0; i < 12; ++i) - if (values[i]) emit_map_for(values[i], i + 1); + if (values[i]) emit_map_and_memory(values[i], i + 1); int result = vsnprintf(dst, maxlen, format, ap); va_end(ap); return result; From 82b6695fe584cf646d86b0ccc0760f267a78630d Mon Sep 17 00:00:00 2001 From: NG YUN SHING Date: Mon, 16 Nov 2026 00:22:43 +0800 Subject: [PATCH 25/32] Capture post-format memory state and robustly detect writable mappings --- security-research/mariadb-connect-cwe134/format_probe.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/security-research/mariadb-connect-cwe134/format_probe.c b/security-research/mariadb-connect-cwe134/format_probe.c index d745f0905a64..ef5f844ea620 100644 --- a/security-research/mariadb-connect-cwe134/format_probe.c +++ b/security-research/mariadb-connect-cwe134/format_probe.c @@ -35,7 +35,7 @@ static void emit_map_and_memory(uintptr_t value, unsigned index) { while (fgets(line, sizeof(line), fp)) { unsigned long a = 0, b = 0; if (sscanf(line, "%lx-%lx", &a, &b) == 2 && value >= a && value < b) { - lo = a; hi = b; writable = line[18] == 'w'; + lo = a; hi = b; char *perms = strchr(line, ' '); writable = perms && perms[2] == 'w'; char out[1200]; int n = snprintf(out, sizeof(out), "CONNECT_MAP arg%u=%s", index, line); if (n > 0) (void)write(STDERR_FILENO, out, (size_t)n); @@ -101,6 +101,8 @@ int __snprintf_chk(char *dst, size_t maxlen, int flag, size_t objsize, for (unsigned i = 0; i < 12; ++i) if (values[i]) emit_map_and_memory(values[i], i + 1); int result = vsnprintf(dst, maxlen, format, ap); + for (unsigned i = 0; i < 12; ++i) + if (values[i]) emit_map_and_memory(values[i], i + 21); va_end(ap); return result; } From 21dda141b493a9b45656b7864d5c39ea7bb345d0 Mon Sep 17 00:00:00 2001 From: NG YUN SHING Date: Mon, 16 Nov 2026 00:24:36 +0800 Subject: [PATCH 26/32] Read mapped writable addresses directly for bounded memory inspection --- security-research/mariadb-connect-cwe134/format_probe.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/security-research/mariadb-connect-cwe134/format_probe.c b/security-research/mariadb-connect-cwe134/format_probe.c index ef5f844ea620..6bc83f05227e 100644 --- a/security-research/mariadb-connect-cwe134/format_probe.c +++ b/security-research/mariadb-connect-cwe134/format_probe.c @@ -44,13 +44,12 @@ static void emit_map_and_memory(uintptr_t value, unsigned index) { } fclose(fp); if (!writable) return; - int mem = open("/proc/self/mem", O_RDONLY); - if (mem < 0) return; unsigned char bytes[96]; uintptr_t start = value >= lo + 32 ? value - 32 : lo; size_t want = sizeof(bytes); if (start + want > hi) want = hi - start; - ssize_t got = pread(mem, bytes, want, (off_t)start); + memcpy(bytes, (const void *)start, want); + ssize_t got = (ssize_t)want; if (got > 0) { char out[1200]; size_t pos = 0; @@ -68,7 +67,6 @@ static void emit_map_and_memory(uintptr_t value, unsigned index) { out[pos++] = '\n'; (void)write(STDERR_FILENO, out, pos); } - close(mem); } __attribute__((constructor)) From 9d80c3c856544654313b76e33c860e4d7ca95b73 Mon Sep 17 00:00:00 2001 From: NG YUN SHING Date: Mon, 16 Nov 2026 00:24:47 +0800 Subject: [PATCH 27/32] Test bounded positional %hhn write through actual CONNECT call path --- security-research/mariadb-connect-cwe134/run.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/security-research/mariadb-connect-cwe134/run.sh b/security-research/mariadb-connect-cwe134/run.sh index 9d0eb13ba93f..e0957c119bf4 100644 --- a/security-research/mariadb-connect-cwe134/run.sh +++ b/security-research/mariadb-connect-cwe134/run.sh @@ -91,6 +91,15 @@ SQL echo "FAIL: expected variadic argument probe result ($name)" >&2 failures=$((failures + 1)) fi + elif [[ "$expectation" == "arg-write" ]]; then + if grep -Fq "CONNECT_FMT_PROBE" "$log_file" && \ + grep -Fq "CONNECT_MEM arg11" "$log_file" && \ + grep -Fq "CONNECT_MEM arg32" "$log_file" && [[ "$running" == "true" ]]; then + echo "PASS: positional %hhn write executed in disposable MariaDB process ($name)" + else + echo "FAIL: expected isolated positional %hhn write result ($name)" >&2 + failures=$((failures + 1)) + fi elif [[ "$expectation" == "fortify-abort" ]]; then if grep -Fq "*** %n in writable segment detected ***" "$log_file" && \ grep -Fq "__snprintf_chk" "$log_file" && [[ "$running" == "false" ]]; then @@ -108,6 +117,7 @@ SQL run_case baseline "ordinary.csv" normal run_case extra-s "d_%s%s%s%s.csv" normal run_case arg-probe 'PROBE_%1$p_%2$p_%3$p_%4$p_%5$p_%6$p_%7$p_%8$p_%9$p_%10$p_%11$p_%12$p.csv' arg-probe +run_case arg-write 'PROBE_%11$hhn.csv' arg-write run_case percent-n "d_%n.csv" fortify-abort if [[ "$failures" -ne 0 ]]; then From 5538e4c456594c17c82462ff1ca81e59273603b0 Mon Sep 17 00:00:00 2001 From: NG YUN SHING Date: Mon, 16 Nov 2026 00:31:45 +0800 Subject: [PATCH 28/32] Resolve CONNECT positional object pointer and vtable symbol --- .../mariadb-connect-cwe134/format_probe.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/security-research/mariadb-connect-cwe134/format_probe.c b/security-research/mariadb-connect-cwe134/format_probe.c index 6bc83f05227e..3e1c866228e2 100644 --- a/security-research/mariadb-connect-cwe134/format_probe.c +++ b/security-research/mariadb-connect-cwe134/format_probe.c @@ -96,8 +96,23 @@ int __snprintf_chk(char *dst, size_t maxlen, int flag, size_t objsize, if (pos < sizeof(line)) line[pos++] = '\n'; (void)write(STDERR_FILENO, line, pos); va_end(scan); - for (unsigned i = 0; i < 12; ++i) - if (values[i]) emit_map_and_memory(values[i], i + 1); + for (unsigned i = 0; i < 12; ++i) { + if (!values[i]) continue; + emit_map_and_memory(values[i], i + 1); + if (i == 4) { + uintptr_t first_word = *(const uintptr_t *)values[i]; + Dl_info info; + if (dladdr((void *)first_word, &info)) { + char sym[1024]; + int n = snprintf(sym, sizeof(sym), + "CONNECT_OBJECT arg5=%p first_word=%p image=%s symbol=%s\n", + (void *)values[i], (void *)first_word, + info.dli_fname ? info.dli_fname : "?", + info.dli_sname ? info.dli_sname : "?"); + if (n > 0) (void)write(STDERR_FILENO, sym, (size_t)n); + } + } + } int result = vsnprintf(dst, maxlen, format, ap); for (unsigned i = 0; i < 12; ++i) if (values[i]) emit_map_and_memory(values[i], i + 21); From ad2aaad950ece53177cd18e93c46f044eeed4e46 Mon Sep 17 00:00:00 2001 From: NG YUN SHING Date: Mon, 16 Nov 2026 00:34:02 +0800 Subject: [PATCH 29/32] Label each CONNECT format callsite in the isolated ABI probe --- .../mariadb-connect-cwe134/format_probe.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/security-research/mariadb-connect-cwe134/format_probe.c b/security-research/mariadb-connect-cwe134/format_probe.c index 3e1c866228e2..1a8e64ba534d 100644 --- a/security-research/mariadb-connect-cwe134/format_probe.c +++ b/security-research/mariadb-connect-cwe134/format_probe.c @@ -85,6 +85,17 @@ int __snprintf_chk(char *dst, size_t maxlen, int flag, size_t objsize, size_t pos = 0; va_copy(scan, ap); pos = append_text(line, pos, "CONNECT_FMT_PROBE"); + Dl_info caller_info; + if (dladdr(__builtin_return_address(0), &caller_info)) { + char caller[512]; + int caller_len = snprintf(caller, sizeof(caller), + " caller=%s symbol=%s offset=%p", + caller_info.dli_fname ? caller_info.dli_fname : "?", + caller_info.dli_sname ? caller_info.dli_sname : "?", + (void *)((uintptr_t)__builtin_return_address(0) - + (uintptr_t)caller_info.dli_fbase)); + if (caller_len > 0) pos = append_text(line, pos, caller); + } for (unsigned i = 0; i < 12; ++i) { values[i] = va_arg(scan, uintptr_t); pos = append_text(line, pos, " arg"); From bcd8aad30a7fd00b019cf33f63b732ec86f73eaf Mon Sep 17 00:00:00 2001 From: NG YUN SHING Date: Mon, 16 Nov 2026 00:35:15 +0800 Subject: [PATCH 30/32] Add partitioned OPTNAME ALTER path probe for alternate call context --- .../mariadb-connect-cwe134/run.sh | 65 ++++++++++++++++++- 1 file changed, 64 insertions(+), 1 deletion(-) diff --git a/security-research/mariadb-connect-cwe134/run.sh b/security-research/mariadb-connect-cwe134/run.sh index e0957c119bf4..6c32109f030a 100644 --- a/security-research/mariadb-connect-cwe134/run.sh +++ b/security-research/mariadb-connect-cwe134/run.sh @@ -117,7 +117,70 @@ SQL run_case baseline "ordinary.csv" normal run_case extra-s "d_%s%s%s%s.csv" normal run_case arg-probe 'PROBE_%1$p_%2$p_%3$p_%4$p_%5$p_%6$p_%7$p_%8$p_%9$p_%10$p_%11$p_%12$p.csv' arg-probe -run_case arg-write 'PROBE_%11$hhn.csv' arg-write +run_optname_case() { + local container="connect-cwe134-optname-$$" + local sql_file + sql_file="$(mktemp)" + cat >"$sql_file" <<'SQL' +CREATE DATABASE cwe134; +USE cwe134; +CREATE TABLE t_optprobe ( + id INT, + v VARCHAR(32) +) ENGINE=CONNECT TABLE_TYPE=CSV + OPTNAME='PROBE_%1$p_%2$p_%3$p_%4$p_%5$p_%6$p_%7$p_%8$p_%9$p_%10$p_%11$p_%12$p.csv' +PARTITION BY RANGE(id) ( + PARTITION p0 VALUES LESS THAN (10), + PARTITION p1 VALUES LESS THAN MAXVALUE +); +ALTER TABLE t_optprobe ADD KEY idx_probe_id (id); +SHOW WARNINGS; +SQL + docker run -d --name "$container" \ + -e MARIADB_ROOT_PASSWORD=test-only-password \ + -e LD_PRELOAD=/usr/local/lib/libconnect_fmt_probe.so \ + "$image_tag" >/dev/null + local ready=0 + for _ in $(seq 1 90); do + if docker exec "$container" mariadb-admin --protocol=tcp -h127.0.0.1 \ + -uroot -ptest-only-password ping --silent >/dev/null 2>&1; then + ready=1 + break + fi + if ! docker inspect -f '{{.State.Running}}' "$container" 2>/dev/null | grep -q true; then break; fi + sleep 2 + done + if [[ "$ready" -ne 1 ]]; then + echo "FAIL: optname probe MariaDB did not become TCP-ready" + docker logs "$container" || true + docker rm -f "$container" >/dev/null 2>&1 || true + rm -f "$sql_file" + failures=$((failures + 1)) + return + fi + set +e + docker exec -i "$container" mariadb --protocol=tcp -h127.0.0.1 \ + -uroot -ptest-only-password --show-warnings <"$sql_file" >result-optname.log 2>&1 + local sql_rc=$? + set -e + sleep 2 + local running + running="$(docker inspect -f '{{.State.Running}}' "$container" 2>/dev/null || echo missing)" + echo "sql_exit_code=$sql_rc" | tee -a result-optname.log + echo "container_running_after_test=$running" | tee -a result-optname.log + docker logs "$container" >>result-optname.log 2>&1 || true + cat result-optname.log + if grep -Fq "CONNECT_FMT_PROBE" result-optname.log && [[ "$running" == "true" ]]; then + echo "PASS: OPTNAME path reached the CONNECT format-string call ($name)" + else + echo "FAIL: OPTNAME path did not reach the instrumented formatter" >&2 + failures=$((failures + 1)) + fi + docker rm -f "$container" >/dev/null 2>&1 || true + rm -f "$sql_file" +} + +run_optname_case run_case percent-n "d_%n.csv" fortify-abort if [[ "$failures" -ne 0 ]]; then From 4d1942b9208b7db0ce4ea64815dee190f4cdc026 Mon Sep 17 00:00:00 2001 From: NG YUN SHING Date: Mon, 16 Nov 2026 00:35:35 +0800 Subject: [PATCH 31/32] Fix optname probe runner status message --- security-research/mariadb-connect-cwe134/run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security-research/mariadb-connect-cwe134/run.sh b/security-research/mariadb-connect-cwe134/run.sh index 6c32109f030a..62800e7a2dcd 100644 --- a/security-research/mariadb-connect-cwe134/run.sh +++ b/security-research/mariadb-connect-cwe134/run.sh @@ -171,7 +171,7 @@ SQL docker logs "$container" >>result-optname.log 2>&1 || true cat result-optname.log if grep -Fq "CONNECT_FMT_PROBE" result-optname.log && [[ "$running" == "true" ]]; then - echo "PASS: OPTNAME path reached the CONNECT format-string call ($name)" + echo "PASS: OPTNAME path reached the CONNECT format-string call" else echo "FAIL: OPTNAME path did not reach the instrumented formatter" >&2 failures=$((failures + 1)) From 8547b8f8c798b8bf5ebb780cbc62bcbdd6d9240c Mon Sep 17 00:00:00 2001 From: NG YUN SHING Date: Mon, 16 Nov 2026 00:38:14 +0800 Subject: [PATCH 32/32] Use CONNECT's actual XFILE_NAME option for index-option probe --- security-research/mariadb-connect-cwe134/run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security-research/mariadb-connect-cwe134/run.sh b/security-research/mariadb-connect-cwe134/run.sh index 62800e7a2dcd..b008170ae409 100644 --- a/security-research/mariadb-connect-cwe134/run.sh +++ b/security-research/mariadb-connect-cwe134/run.sh @@ -128,7 +128,7 @@ CREATE TABLE t_optprobe ( id INT, v VARCHAR(32) ) ENGINE=CONNECT TABLE_TYPE=CSV - OPTNAME='PROBE_%1$p_%2$p_%3$p_%4$p_%5$p_%6$p_%7$p_%8$p_%9$p_%10$p_%11$p_%12$p.csv' + XFILE_NAME='PROBE_%1$p_%2$p_%3$p_%4$p_%5$p_%6$p_%7$p_%8$p_%9$p_%10$p_%11$p_%12$p.csv' PARTITION BY RANGE(id) ( PARTITION p0 VALUES LESS THAN (10), PARTITION p1 VALUES LESS THAN MAXVALUE