惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

U
Unit 42
T
Threatpost
C
CERT Recently Published Vulnerability Notes
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Security Archives - TechRepublic
Security Archives - TechRepublic
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
K
Kaspersky official blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Attack and Defense Labs
Attack and Defense Labs
N
News and Events Feed by Topic
Project Zero
Project Zero
H
Heimdal Security Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Know Your Adversary
Know Your Adversary
Google Online Security Blog
Google Online Security Blog
W
WeLiveSecurity
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Schneier on Security
Schneier on Security
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
N
News | PayPal Newsroom
Hacker News - Newest:
Hacker News - Newest: "LLM"
H
Hacker News: Front Page
L
LINUX DO - 热门话题
Spread Privacy
Spread Privacy
T
Threat Research - Cisco Blogs
Cloudbric
Cloudbric
V
Vulnerabilities – Threatpost
Hacker News: Ask HN
Hacker News: Ask HN
S
Securelist
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
TaoSecurity Blog
TaoSecurity Blog
NISL@THU
NISL@THU
N
News and Events Feed by Topic
S
Security Affairs
The Last Watchdog
The Last Watchdog
T
Tor Project blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
T
The Exploit Database - CXSecurity.com
Simon Willison's Weblog
Simon Willison's Weblog
P
Palo Alto Networks Blog
AWS News Blog
AWS News Blog
P
Proofpoint News Feed
C
Cisco Blogs
C
Cyber Attacks, Cyber Crime and Cyber Security
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
L
LINUX DO - 最新话题
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
T
Tenable Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
S
Schneier on Security

MariaDB.org

IBM continues as a Platinum Sponsor of MariaDB Foundation - MariaDB.org Say the Name: MariaDB, MySQL, and the Ecosystem We Share - MariaDB.org Deploying the MariaDB Privacy-First Stack Anywhere with Terraform - MariaDB.org From PostgreSQL 12 to MariaDB 11: A Gradual Fintech Migration with 23% Lower TCO - MariaDB.org MariaDB 13.1 Feature in Focus: Validate Your Configuration Before Starting the Server - MariaDB.org MariaDB Hidden Gem: Online Schema Change without pt-osc - MariaDB.org MariaDB 13.1 Feature in Focus: BLOB, TEXT, JSON and GEOMETRY Support in the HEAP Engine - MariaDB.org MariaDB Foundation Sea Lion Champions Nominees: Federico Razzoli - MariaDB.org TAF 3.0 — Results Backend With Automated Performance Change Detection - MariaDB.org MariaDB 13.1 Feature in Focus: DENY / Negative Grants - MariaDB.org Continuent joins MariaDB Foundation as a Silver Sponsor - MariaDB.org Lowering the Barrier for MariaDB Plugin Development: Plugins in More Languages - MariaDB.org Nextcloud renews its Silver sponsorship of MariaDB Foundation - MariaDB.org MariaDB Foundation Sea Lion Champions Nominees: Fariha Shaikh - MariaDB.org MariaDB Privacy-First Stack: Nextcloud, Passbolt and MariaDB Server - MariaDB.org Passbolt renews its support for MariaDB Foundation - MariaDB.org Aqtra Joins MariaDB Foundation as a Gold Sponsor - MariaDB.org MariaDB 13.1 Preview: This One Is Full of Community Goodies! - MariaDB.org MariaDB 13.1 preview available - MariaDB.org Simple tool to build MariaDB commits for performance-change analysis - MariaDB.org MariaDB Vector in Laravel: insights on choosing an embedding model - MariaDB.org MariaDB Server 10.6 Reaches End of Life on July 6th - MariaDB.org MariaDB Foundation Sea Lion Champions Nominees: Sylvain Arbaudie - MariaDB.org MariaDB + DuckDB: A New Playground for Analytics – A First Look at the New Storage Engine MariaDB Server 12.3, 11.8, 11.4, 10.11, 10.6 – May 2026’s releases: thank you for your contributions DuckDB Storage Engine for MariaDB. When the Sea Lion Learns to Quack. MariaDB Foundation Sea Lion Champions Nominees: Mark Callaghan MariaDB Foundation Sea Lion Champions Nominees: Sumit Srivastava The Power Of The Community! MariaDB Hidden Gem: Create Aggregate Function Celebrating the MariaDB Foundation Sea Lions Champions Nominees MariaDB Foundation: Bringing TPC-B Back To Life MariaDB Community Server Corrective Releases A New Pull Request Processing Time Record MariaDB Server 12.3 LTS Released MariaDB Foundation at Oracle’s MySQL Contributor Summit: Ecosystems, Forks and Constructive Coexistence Virtuozzo Renews Sponsorship of MariaDB Foundation ProxySQL joins MariaDB Foundation as Silver Sponsor Drupal recommends MariaDB Vibe-coding an Audit Plugin in Under 3 Minutes Introducing Our First MariaDB Server Solution Stack: A Privacy-First Stack with Nextcloud, Passbolt, and MariaDB Documented: The MariaDB Server (Community) Contribution Process Unleashing Innovation Through Plugins Adding a New Data Type to MariaDB with Type_handler – Part 5
MariaDB Server Plugins: disabled functions - MariaDB.org
Frédéric Descamps · 2026-07-06 · via MariaDB.org

During the last MariaDB Foundation Board Meeting (24 June 2026), Barry shared how it can be difficult to deploy an upgrade immediately and that they sometimes have to wait for one that fixes security bugs. Wait for the validation, wait for the fix, and the release. Even if the MariaDB engineers are doing incredible work, it might still not be fast enough for the security team.

That’s where Barry requested MariaDB implement a query-rewriter plugin, like the one in MySQL, to address the fact that, in a multi-tenant environment, certain queries that would trigger known vulnerabilities are never legitimately used by applications.

So I wrote something similar, but unfortunately, this didn’t solve the problem. Queries are way too different. For example, these two queries will provide two different digests or normalized forms:

select now() as nu;

select now() as maintenant;

So this solution was discarded, and we discussed maybe using a regular expression, but that might become too heavy; it would be better to use a proxy like MaxScale with the rewrite or regexp filter.

And then the real problem arose: most of their issues stemmed from built-in functions they never use in their application, but that could become dangerous. So they asked if it was possible to “just” disable some built-in functions

The Solution

Of course, there is nothing currently implemented in MariaDB Server that allows the DBA to disable built-in functions.

But our Chief Architect, Sergei Golubchik, had an idea: a dynamic plugin loaded at startup could disable a function and return an error. We could monkey-patch a C++ virtual method at runtime by directly modifying a class’s vtable.

Monkey-patching means changing the behavior of existing code at runtime, rather than by editing and recompiling the original source. It’s primarily used in dynamic languages like Python and JavaScript to add, replace, or suppress functionality in memory.

That rang a bell and opened a new perspective to reach the desired objective.

The key idea

MariaDB has internal registries of built-in SQL functions, represented as arrays:

extern Native_func_registry_array native_func_registry_array;
extern Native_func_registry_array native_func_registry_array_geom;
extern Native_func_registry_array oracle_func_registry_array;

Each entry looks like this:

struct Native_func_registry
{
  LEX_CSTRING name;
  Create_func *builder;
};

Meaning that each function has a name and a builder (an object used to create the function expression).

Finally, MariaDB also has hash tables used to look up functions quickly:

extern Native_functions_hash native_functions_hash;
extern Native_functions_hash native_functions_hash_oracle;

So when a SQL statement contains something like:

SELECT SLEEP(10);

MariaDB parses SLEEP, searches the function registry/hash, finds its Create_func *builder, and uses that to construct the function call.

This plugin simply removes selected entries from those hashes.

After removal, the function still exists in the compiled MariaDB code, but the SQL layer can no longer resolve its name via the normal native-function lookup path.

Creating a plugin for MariaDB Server isn’t complicated (see this page), so I tried to write a plugin that, when loaded at startup, would disable functions referenced by a global read-only variable using the key idea above.

The plugin is available on my GitHub repository.

When compiled and installed, you can load the module directly from the my.cnf:

[mariadb]
plugin_load_add=disabled_functions
disabled_functions=SLEEP,COLUMN_LIST

This will load the plugin and disable the commands SLEEP() and COLUMN_LIST():

MariaDB [test]> SELECT * FROM information_schema.PLUGINS  
                WHERE plugin_name = 'disabled_functions'\G
*************************** 1. row ***************************
           PLUGIN_NAME: disabled_functions
        PLUGIN_VERSION: 1.0
         PLUGIN_STATUS: ACTIVE
           PLUGIN_TYPE: DAEMON
   PLUGIN_TYPE_VERSION: 130100.0
        PLUGIN_LIBRARY: disabled_functions.so
PLUGIN_LIBRARY_VERSION: 1.15
         PLUGIN_AUTHOR: lefred
    PLUGIN_DESCRIPTION: Disables selected native built-in SQL functions
        PLUGIN_LICENSE: GPL
           LOAD_OPTION: ON
       PLUGIN_MATURITY: Experimental
   PLUGIN_AUTH_VERSION: 1.0
1 row in set (0.002 sec)

MariaDB [test]> SHOW GLOBAL VARIABLES LIKE 'disabled_functions_list';
+-------------------------+-------------------+
| Variable_name           | Value             |
+-------------------------+-------------------+
| disabled_functions_list | SLEEP,COLUMN_LIST |
+-------------------------+-------------------+
1 row in set (0.000 sec)

Now let’s try to use one of these functions:

MariaDB [test]> select sleep();
ERROR 1305 (42000): FUNCTION test.sleep does not exist
MariaDB [test]> select sleep(10);
ERROR 1305 (42000): FUNCTION test.sleep does not exist
MariaDB [test]> select sleep('fred');
ERROR 1305 (42000): FUNCTION test.sleep does not exist
MariaDB [test]> 

The plugin works exactly as expected.

Conclusion

This is not a wow-feature plugin, but it illustrates how flexible MariaDB is and how quickly it’s possible to extend it with a feature that could be used in production.

Please give it a try, and if you code some plugins, please share them with me. I will be happy to test them.

As usual, enjoy MariaDB Server and enjoy hacking!