#2479·oceanbase

DBMS_TRUSTED_CERTIFICATE_MANAGER fails for a certificate common name containing a quote

Author: Wwwing301Created Sep 1, 2026Updated Sep 1, 2026

Self Checks

  • I have read the Contributing Guide.
  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

OceanBase version

OceanBase CE 5.0.2.0, source revision d128661ca4f5b3d167c1928e556d70d2f901baef, Release+ASan.

Self Hosted

Self Hosted (Source)

Environment

Ubuntu 22.04.5 LTS, x86_64, one-zone loopback observer.

Steps to reproduce

First run the control, which succeeds even though no matching row exists:

sql
CALL DBMS_TRUSTED_CERTIFICATE_MANAGER.DELETE_TRUSTED_CERTIFICATE(
  'EDBF_SAFE_NONEXISTENT');

Then pass a legal SQL string whose decoded value ends in one single quote:

sql
CALL DBMS_TRUSTED_CERTIFICATE_MANAGER.DELETE_TRUSTED_CERTIFICATE(
  'EDBF_TRUSTED_CERT_SENTINEL_20260901''');

The second call returns syntax error 1064. The observer diagnostic exposes the malformed internal statement; complete authoritative logs are bundled as artifacts/observer.log and artifacts/rootservice.log:

delete from __all_trusted_root_certificate
  where common_name='EDBF_TRUSTED_CERT_SENTINEL_20260901''
execute sql failed(...)

src/pl/sys_package/ob_pl_dbms_trusted_certificate_manager.cpp:120-146 constructs this statement with sql.assign_fmt(... common_name ...) and sends it through the MySQL proxy without escaping the SQL literal.

artifacts.zip

✔️ Expected Behavior

The package should treat a quote as data, issue a syntactically valid delete, and return success for a nonexistent quoted common name just as it does for the control.

❌ Actual Behavior

The interpolated quote terminates the generated SQL literal and the package fails with syntax error. The run did not execute a second statement, alter data, escalate privileges, or demonstrate SQL-injection impact; the proven impact is failure to handle a valid common-name value safely.