Skip to content
RCE Write-up Intermediate

The Vulnerability That Was Hiding In Three Places At Once

DBD::DBM accepted attacker-controlled values for the dbm_type and dbm_mldbm connection attributes and passed them to Perl's require without validation, allowing arbitrary module loading. An attacker who could influence these attributes could execute arbitrary code when the module was loaded.

medium.com

Published on medium.com

Cybersecurity

Harsh Raj Singhania, on medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 8 min read.

Context

DBI is the Database Interface module for Perl: the middle layer between Perl code and whatever database it talks to, whether MySQL, Postgres or something else. DBI does not work alone. Each supported database has a companion driver module whose name starts with DBD, such as DBD::mysql or DBD::Pg. The driver at the centre of this story is DBD::DBM, which talks to a dbm file, a basic key-value store that has been part of Perl's world for a long time and is still used because it is small, dependency free and just works.

When you connect through DBI you pass a connection string and a set of attributes that tell the driver how to behave. Two of those attributes matter here:

  • dbm_type tells DBD::DBM which dbm backend module to use underneath, for example NDBM_File or DB_File.
  • dbm_mldbm selects the MLDBM serializer used to store more complex data than plain text or numbers, for example Storable or JSON.

Both attributes exist for good reasons. The problem is what DBD::DBM does with the value you give them. The bug is CVE-2026-78030, an arbitrary module load in DBD::DBM, classified by GitHub's advisory under CWE-470, Use of Externally Controlled Input to Select Classes or Code.

CVE-2026–78030 From the original on medium.com

Setup

The researcher worked against the real perl5-dbi/dbi source repository rather than a rewritten copy, on the principle that a rewrite can accidentally fix the exact bug you are trying to prove. The proof of concept is a Perl script that creates a rogue module in a temporary directory, adds that directory to @INC, and then fires the same construction DBD::DBM uses internally. No special accounts or roles are involved; the precondition is simply that an application lets something other than the developer influence dbm_type or dbm_mldbm.

Finding it

This was the researcher's second CVE in the same repository. The first, CVE-2026-73194, was found by accident while reading two older fixes in DBI. After that one was confirmed and fixed, the researcher stayed in the repository and read it function by function, looking for anything else that had been sitting there unnoticed. That is how CVE-2026-78030 turned up. Unlike the first, it is not a crash: it is a way to make the program run code an attacker chose.

The assumption underneath the bug is that DBD::DBM checks whether dbm_type and dbm_mldbm are attributes it recognises by name, against a small internal list:

PERL
my %dbm_valid_attrs = (    dbm_type  => 1,    dbm_mldbm => 1,    ...);

That check only answers whether the attribute name is real. It says nothing about the value inside it. The code checks the label on the box, never what is inside, and whatever is inside is carried through to a line that loads and runs a Perl module by name.

The same mistake appears in three separate places in the same file.

The first spot is the most direct:

PERL
my $tie_type = $meta->{dbm_type};$INC{"$tie_type.pm"} or require "$tie_type.pm";

Whatever string is in dbm_type is appended with .pm and handed to require. Setting it to NDBM_File loads NDBM_File as intended; setting it to a module the attacker controls loads that instead, and runs whatever code sits at the top of the file the moment it loads.

The second spot looks like it has a safety net, but the net has a hole:

PERL
my $ser_class = "MLDBM::Serializer::" . $meta->{dbm_mldbm};my $ser_mod   = $ser_class;$ser_mod =~ s|::|/|g;$ser_mod .= ".pm";require $ser_mod;

The value is glued behind MLDBM::Serializer::, so on the surface only something inside that folder can be loaded. But the substitution only rewrites the double colon :: into a slash. It does nothing about an actual slash character placed in the value. A value such as ../../../../tmp/evil_serializer passes through the substitution untouched, and the path it builds walks back out of the folder it was supposed to be locked inside. The wall was built to stop one specific character pattern, not the character itself.

The third spot does not look like a loading bug at first glance:

PERL
$MLDBM::Serializer = $meta->{dbm_mldbm};

The raw value is stored directly into a variable that MLDBM checks every time it needs to load or save something from the table, not once at connection time but on every read and every write. It is the same underlying problem reached from a different angle, and triggered far more often.

Three doors, the same lock missing on all three.

Exploitation

Step one: build something that proves it was loaded

A normal, well-behaved Perl module does not announce itself, so the proof of concept first creates a rogue module whose only purpose is to leave evidence when it loads:

PERL
my $tmpdir = tempdir(CLEANUP => 1);make_path("$tmpdir/Rogue");
PERL
my $sentinel_file = "$tmpdir/rogue_loaded.txt";open my $fh, '>', "$tmpdir/Rogue/Module.pm" or die $!;print $fh <<"EVIL_MODULE";package Rogue::Module;open(my \$fh, '>', '$sentinel_file') or die "cannot write sentinel: \$!";print \$fh "LOADED by PID \$\$ at " . scalar(localtime) . "\\n";close \$fh;warn "[Rogue::Module] load-time code executed!\\n";1;EVIL_MODULEclose $fh;

This writes a real .pm file called Rogue/Module.pm to disk. The file writes a timestamp and its own process ID into a separate marker file the instant it is loaded, like a doorbell camera for code execution. If the marker file appears, something ran code it should not have been able to run. In a real attack this is the part that would be swapped out: instead of writing a timestamp, this is where system($cmd) or anything else the attacker wants executed would go.

Step two: get the rogue module somewhere Perl will find it

require does not search the whole filesystem; it looks only inside the folders listed in @INC. The proof of concept puts the temp folder holding the rogue module at the front of that list:

PERL
unshift @INC, $tmpdir;

In a real attack, something like a PERL5LIB environment variable, a misconfigured shared library path or an already-writable temp directory would normally do this job. It is not part of the vulnerability; it recreates the ordinary condition an attacker would already have.

Step three: fire the exact line DBD::DBM fires

The line below is not a rewrite or a simplification. It is the same construction, doing the same thing, that sits inside DBD::DBM itself:

PERL
my $attacker_value = "Rogue::Module";my $require_target = $attacker_value;       eval { require "Rogue/Module.pm" };

$attacker_value stands in for whatever would be put into the dbm_type connection attribute. There is no check anywhere between that value and the require call. It goes in as a plain string and comes out as a command to load and run a file. The run produced:

Text
[Rogue::Module] load-time code executed!
Text
*** CONFIRMED: load-time code ran! Sentinel content:    LOADED by PID 551 at Thu Aug 20 18:13:55 2026

The marker file existing is the whole proof. The rogue module's code ran on its own the moment require touched it, purely because of the string handed to dbm_type. Nothing required tricking DBI into doing something it was not designed to do: require did exactly what require is supposed to do. The only mistake was letting an outside value decide what gets required.

The second door, shown the same way

The same script walks the dbm_mldbm path, building the exact string DBD::DBM would build internally, over a set of payloads:

PERL
my @mldbm_payloads = (    "Storable",    "JSON",    "../../../../tmp/evil_serializer",    "Evil::Deserializer",);
PERL
for my $v (@mldbm_payloads) {    my $ser_class = "MLDBM::Serializer::" . $v;    (my $ser_mod = $ser_class) =~ s|::|/|g;    $ser_mod .= ".pm";    printf "dbm_mldbm='%s'\n  => require '%s'\n\n", $v, $ser_mod;}

Running that over the traversal value produces:

Text
dbm_mldbm='../../../../tmp/evil_serializer'  => require 'MLDBM/Serializer/../../../../tmp/evil_serializer.pm'

The MLDBM::Serializer:: prefix sits at the front exactly as it should, and then the ../../../../ walks straight back out of it. The code is not tricked into producing this string; it builds it correctly, following its own rules, using a value nobody checked first.

Why there is no third proof of concept

The researcher did not build a separate proof for the third door, the assignment into $MLDBM::Serializer on every table read and write. Steps one to three already prove that an attacker-controlled string reaching a bare require in this codebase results in real code execution. The third door hands the same kind of string to the same underlying mechanism from a different variable, and more often. Once the lock is shown to be missing on the front door, there is no need to pick the side door to know it works the same way.

Root cause

The validation in DBD::DBM is name-based only. dbm_type and dbm_mldbm are accepted because they appear in %dbm_valid_attrs, and their values are then used to build module names for require without any allow-list check. In the dbm_mldbm path, the MLDBM::Serializer:: prefix and the s|::|/|g substitution look like containment, but the substitution only handles the :: sequence and leaves literal slashes and .. segments intact, so the constructed path can escape the intended directory. The third path skips the prefix entirely by writing the raw value into $MLDBM::Serializer, which MLDBM consults on every load and save. In all three cases the existing defence answers the wrong question: it confirms the attribute name is known, not that the value is safe.

Impact

This is not a bug that lets a random stranger break into any Perl program that uses DBI. It matters wherever an application lets a less trusted source influence dbm_type or dbm_mldbm. That is narrower but real: a multi-tenant application that builds part of its connection string from user-submitted data, a config value inherited from a lower trust tier, or attributes relayed through DBI's Gofer proxy setup from a client. Anywhere one of those two values can be nudged by someone other than the developer, this is a path to code execution rather than a hypothetical. If you control the value, you control what module loads, and whatever sits at the top level of that module runs immediately. That is why the advisory rates it High, above the heap out-of-bounds write of the earlier CVE-2026-73194, which was serious but bounded and might have needed real effort to push further.

Fix

The issue was reported with a full writeup and a working proof of concept straight to DBI's maintainer, handled by robrwo, and fixed without pushback. The patch landed in DBI 1.653. In that release both attributes are checked against a list of known-safe values before anything gets loaded. If you use DBD::DBM and either attribute can be influenced by anything other than a value you hardcoded, upgrade to DBI 1.653 or later. If you cannot upgrade immediately, do not pass either attribute through from user input, config inherited from a less trusted layer, or anything relayed from a client connection: hardcode them, or check them yourself against a small allow-list before they reach DBI.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 19 min read.

What happened, in plain words

A security researcher found a bug in a piece of software that many Perl programs rely on. The bug lets someone who is not the programmer decide which extra piece of code the program loads and runs. If you can choose the code, you can make the program do what you want, including running commands on the machine. The bug is tracked as CVE-2026-78030, and it was fixed in a release called DBI 1.653.

To follow the story you only need a few ideas. A program is a set of instructions a computer follows. A library (also called a module) is a bundle of ready-made instructions that other programs borrow instead of writing everything from scratch, a bit like using a recipe book instead of inventing every dish. Perl is a programming language, and the library in question is called DBI.

CVE-2026–78030 From the original on medium.com

The image at the top of the write-up is a banner carrying the identifier CVE-2026-78030, the label given to this particular bug.

The software involved, explained from zero

DBI stands for Database Interface. It is the middle layer between a Perl program and a database. A database is an organised store of information, like a very large, very strict spreadsheet that a program can ask questions of. Your program talks to DBI, and DBI talks to the database. Think of DBI as a translator sitting between two people who speak different languages.

DBI does not work alone. For each kind of database it supports there is a smaller companion module called a driver, and driver names start with DBD, short for Database Driver. DBD::mysql talks to MySQL, DBD::Pg talks to Postgres. The driver in this story is DBD::DBM, which talks to a dbm file. A dbm file is a very simple storage format: you give it a label (a key) and it gives you back the thing stored under that label (the value), like a coat check where you hand in a ticket and get your coat. It is small, needs no extra software, and has been used in Perl for a very long time.

When a program connects through DBI it passes a connection string (text describing where and how to connect) plus a set of attributes. An attribute is just a named setting, like the options in a printer dialogue: paper size, colour, double-sided. Two of those settings matter here:

  • dbm_type tells DBD::DBM which specific dbm backend module to use underneath, for example NDBM_File or DB_File.
  • dbm_mldbm selects the MLDBM serializer used to store more complex data than plain text or numbers, for example Storable or JSON. A serializer is a converter: it turns a complicated structure into a stream of bytes for storage and turns it back again later, like vacuum-packing a meal so it fits in the freezer.

Both settings exist for good reasons. The problem is what DBD::DBM does with the value you give them. The bug is CVE-2026-78030, an arbitrary module load in DBD::DBM. "Arbitrary" here means "whatever the attacker picks", and "module load" means "make Perl fetch and run a module". GitHub's advisory classifies it under CWE-470, Use of Externally Controlled Input to Select Classes or Code. In plain terms: the program lets an outside party decide which code runs, not merely which data is processed.

How the researcher set up the test

The researcher worked against the real perl5-dbi/dbi source repository rather than a rewritten copy. A source repository is the shared folder where the actual code of a project lives, with its history of changes. The reason for using the real thing is simple: if you retype code from memory, you might accidentally fix the very bug you are trying to prove. It is like testing a lock on the actual door rather than on a drawing of the door.

The proof of concept is a Perl script. A proof of concept is a small, safe demonstration that a bug is real, built so that it does no harm: it shows the door opens without actually robbing the house. The script creates a rogue module in a temporary directory, adds that directory to @INC, and then fires the same construction DBD::DBM uses internally. We will unpack each of those pieces as they appear.

No special accounts or roles are involved. The precondition is simply that an application lets something other than the developer influence dbm_type or dbm_mldbm.

How the bug was found

This was the researcher's second CVE in the same repository. A CVE is a public catalogue number given to a confirmed security flaw so that everyone can refer to the same thing. The first, CVE-2026-73194, was found by accident while reading two older fixes in DBI. After that one was confirmed and fixed, the researcher stayed in the repository and read it function by function, looking for anything else that had been sitting there unnoticed. That is how CVE-2026-78030 turned up. Unlike the first, it is not a crash: it is a way to make the program run code an attacker chose.

A function is a named block of instructions inside a program, a small task the program can call by name. Reading a codebase function by function means going through it methodically rather than skimming, the way a proofreader checks a document line by line instead of glancing at the page.

The assumption underneath the bug is that DBD::DBM checks whether dbm_type and dbm_mldbm are attributes it recognises by name, against a small internal list:

PERL
my %dbm_valid_attrs = (    dbm_type  => 1,    dbm_mldbm => 1,    ...);

Line by line:

  • my %dbm_valid_attrs = (...) creates a hash, which in Perl is a lookup table of key-and-value pairs, like a guest list at a door. The name %dbm_valid_attrs means "the attributes DBD::DBM considers valid".
  • dbm_type => 1 puts the name dbm_type on the list, marked with the value 1, meaning "yes, this one is known".
  • dbm_mldbm => 1 does the same for the second setting.
  • The ... stands for other entries the report does not spell out.

That check only answers whether the attribute name is real. It says nothing about the value inside it. The code checks the label on the box, never what is inside, and whatever is inside is carried through to a line that loads and runs a Perl module by name. This is the heart of the whole story: a guest list that checks your name but never looks in your bag.

Three places the same mistake was made

The same mistake appears in three separate places in the same file. A file here is one source-code document inside the project, and the three spots are three different passages in it.

The first spot is the most direct:

PERL
my $tie_type = $meta->{dbm_type};$INC{"$tie_type.pm"} or require "$tie_type.pm";

Line by line:

  • my $tie_type = $meta->{dbm_type}; copies the value of the dbm_type setting into a variable called $tie_type. A variable is a named box in the program that holds a value. $meta is a structure holding the connection settings, and ->{dbm_type} reaches into it for that one setting.
  • $INC{"$tie_type.pm"} looks in %INC, Perl's record of modules already loaded, to see whether a module with that name plus .pm has been loaded before. The .pm suffix is the usual file extension for a Perl module.
  • or require "$tie_type.pm"; runs only if the lookup failed: it asks Perl to load that module. require is Perl's built-in instruction for loading a module by name.

Whatever string is in dbm_type is appended with .pm and handed to require. Setting it to NDBM_File loads NDBM_File as intended; setting it to a module the attacker controls loads that instead, and runs whatever code sits at the top of the file the moment it loads. The top of a module file is its top-level code: instructions that run as soon as the file is loaded, before anyone calls anything in it.

The second spot looks like it has a safety net, but the net has a hole:

PERL
my $ser_class = "MLDBM::Serializer::" . $meta->{dbm_mldbm};my $ser_mod   = $ser_class;$ser_mod =~ s|::|/|g;$ser_mod .= ".pm";require $ser_mod;

Line by line:

  • my $ser_class = "MLDBM::Serializer::" . $meta->{dbm_mldbm}; glues the fixed text MLDBM::Serializer:: in front of the value of dbm_mldbm. The dot is Perl's way of joining two pieces of text.
  • my $ser_mod = $ser_class; copies that combined text into a second variable.
  • $ser_mod =~ s|::|/|g; is a substitution: it replaces every :: with a /. In Perl, :: separates parts of a module name, and / separates folders in a file path, so this line converts a module name into a path. The g at the end means "do it everywhere in the string".
  • $ser_mod .= ".pm"; appends the .pm extension.
  • require $ser_mod; loads the module at that path.

The value is glued behind MLDBM::Serializer::, so on the surface only something inside that folder can be loaded. But the substitution only rewrites the double colon :: into a slash. It does nothing about an actual slash character placed in the value. A value such as ../../../../tmp/evil_serializer passes through the substitution untouched, and the path it builds walks back out of the folder it was supposed to be locked inside. The wall was built to stop one specific character pattern, not the character itself.

The .. sequence means "go up one folder" in a file path. Four of them in a row climb four folders up, which is how a path that starts inside a folder can end up somewhere else entirely. It is like being told to stay in room 4 of a building and finding a corridor sign that says "back, back, back, back" and leads you out of the building.

The third spot does not look like a loading bug at first glance:

PERL
$MLDBM::Serializer = $meta->{dbm_mldbm};

Line by line:

  • $MLDBM::Serializer is a package variable, a named box that belongs to the MLDBM library and that other code can read and write.
  • = $meta->{dbm_mldbm}; stores the raw value of the setting straight into that box, with no prefix and no substitution at all.

The raw value is stored directly into a variable that MLDBM checks every time it needs to load or save something from the table, not once at connection time but on every read and every write. It is the same underlying problem reached from a different angle, and triggered far more often.

Three doors, the same lock missing on all three.

Proving it against the actual code

Step one: build something that proves it was loaded

A normal, well-behaved Perl module does not announce itself, so the proof of concept first creates a rogue module whose only purpose is to leave evidence when it loads:

PERL
my $tmpdir = tempdir(CLEANUP => 1);make_path("$tmpdir/Rogue");

Line by line:

  • my $tmpdir = tempdir(CLEANUP => 1); creates a temporary directory, a scratch folder the system makes for short-lived work, and stores its path in $tmpdir. CLEANUP => 1 asks for the folder to be deleted automatically afterwards, so the test leaves no mess.
  • make_path("$tmpdir/Rogue"); creates a subfolder called Rogue inside it, ready to hold the fake module.
PERL
my $sentinel_file = "$tmpdir/rogue_loaded.txt";open my $fh, '>', "$tmpdir/Rogue/Module.pm" or die $!;print $fh <<"EVIL_MODULE";package Rogue::Module;open(my \$fh, '>', '$sentinel_file') or die "cannot write sentinel: \$!";print \$fh "LOADED by PID \$\$ at " . scalar(localtime) . "\\n";close \$fh;warn "[Rogue::Module] load-time code executed!\\n";1;EVIL_MODULEclose $fh;

Line by line:

  • my $sentinel_file = "$tmpdir/rogue_loaded.txt"; decides the path of a marker file, called a sentinel, that will exist only if the rogue module runs. A sentinel is a tripwire: something whose mere presence tells you what happened.
  • open my $fh, '>', "$tmpdir/Rogue/Module.pm" or die $!; opens a new file called Module.pm for writing. $fh is a file handle, the program's grip on the open file. or die $! stops the script with an error message if the file cannot be opened.
  • print $fh <<"EVIL_MODULE"; starts writing a block of text into that file. The <<"EVIL_MODULE" notation means "everything up to the line that says EVIL_MODULE is the text to write".
  • package Rogue::Module; names the module Rogue::Module, matching the folder and file name.
  • open(my \$fh, '>', '$sentinel_file') or die "cannot write sentinel: \$!"; is code that will run when the module loads: it opens the sentinel file for writing.
  • print \$fh "LOADED by PID \$\$ at " . scalar(localtime) . "\\n"; writes a line into the sentinel containing the word LOADED, the PID (process identifier, the number the operating system gives a running program) and the current date and time.
  • close \$fh; closes the sentinel file.
  • warn "[Rogue::Module] load-time code executed!\\n"; prints a warning to the screen, a second piece of evidence.
  • 1; is the conventional ending of a Perl module: it returns a true value so the loader knows the file loaded correctly.
  • EVIL_MODULE on its own line ends the block of text.
  • close $fh; closes the module file after writing.

This writes a real .pm file called Rogue/Module.pm to disk. The file writes a timestamp and its own process ID into a separate marker file the instant it is loaded, like a doorbell camera for code execution. If the marker file appears, something ran code it should not have been able to run. In a real attack this is the part that would be swapped out: instead of writing a timestamp, this is where system($cmd) or anything else the attacker wants executed would go. system is the Perl instruction that runs an operating-system command, so that one line is the difference between a harmless note and a real intrusion.

Step two: get the rogue module somewhere Perl will find it

require does not search the whole filesystem; it looks only inside the folders listed in @INC. @INC is Perl's list of search folders for modules, like the list of shelves a librarian will check for a book. The proof of concept puts the temp folder holding the rogue module at the front of that list:

PERL
unshift @INC, $tmpdir;

Line by line:

  • unshift @INC, $tmpdir; adds $tmpdir to the beginning of the @INC list. unshift means "put at the front", so this folder is searched before all the normal ones.

In a real attack, something like a PERL5LIB environment variable, a misconfigured shared library path or an already-writable temp directory would normally do this job. An environment variable is a named setting the operating system passes to programs when they start, and PERL5LIB is the one that tells Perl where to look for modules. It is not part of the vulnerability; it recreates the ordinary condition an attacker would already have.

Step three: fire the exact line DBD::DBM fires

The line below is not a rewrite or a simplification. It is the same construction, doing the same thing, that sits inside DBD::DBM itself:

PERL
my $attacker_value = "Rogue::Module";my $require_target = $attacker_value;       eval { require "Rogue/Module.pm" };

Line by line:

  • my $attacker_value = "Rogue::Module"; sets the string that stands in for whatever an attacker would put into the dbm_type setting.
  • my $require_target = $attacker_value; copies it into another variable, mirroring how the real code carries the value along.
  • eval { require "Rogue/Module.pm" }; performs the load inside eval, which means "try this and do not crash the whole script if it fails". The path is the one built from the attacker's string.

$attacker_value stands in for whatever would be put into the dbm_type connection attribute. There is no check anywhere between that value and the require call. It goes in as a plain string and comes out as a command to load and run a file. The run produced:

Text
[Rogue::Module] load-time code executed!
Text
*** CONFIRMED: load-time code ran! Sentinel content:    LOADED by PID 551 at Thu Aug 20 18:13:55 2026

The first block is the warning the rogue module printed as it loaded. The second is the script reporting that the sentinel file exists and showing what is inside it: the word LOADED, the process ID 551 and the time.

The marker file existing is the whole proof. The rogue module's code ran on its own the moment require touched it, purely because of the string handed to dbm_type. Nothing required tricking DBI into doing something it was not designed to do: require did exactly what require is supposed to do. The only mistake was letting an outside value decide what gets required.

The second door, shown the same way

The same script walks the dbm_mldbm path, building the exact string DBD::DBM would build internally, over a set of payloads. A payload is the value an attacker sends to try to trigger the bug.

PERL
my @mldbm_payloads = (    "Storable",    "JSON",    "../../../../tmp/evil_serializer",    "Evil::Deserializer",);

Line by line:

  • my @mldbm_payloads = (...) creates a list (in Perl, an array) of test values. The @ sigil marks a list, just as $ marks a single value.
  • "Storable" and "JSON" are ordinary, legitimate serializer names, included so the output shows what normal use looks like.
  • "../../../../tmp/evil_serializer" is the traversal value: a path that climbs out of the intended folder.
  • "Evil::Deserializer" is a made-up module name, another shape of the same idea.
PERL
for my $v (@mldbm_payloads) {    my $ser_class = "MLDBM::Serializer::" . $v;    (my $ser_mod = $ser_class) =~ s|::|/|g;    $ser_mod .= ".pm";    printf "dbm_mldbm='%s'\n  => require '%s'\n\n", $v, $ser_mod;}

Line by line:

  • for my $v (@mldbm_payloads) { loops over the list, putting each value into $v in turn. A loop repeats the same instructions for each item.
  • my $ser_class = "MLDBM::Serializer::" . $v; glues the fixed prefix in front of the current value, exactly as the real code does.
  • (my $ser_mod = $ser_class) =~ s|::|/|g; copies it and replaces every :: with /, again exactly as the real code does.
  • $ser_mod .= ".pm"; appends the .pm extension.
  • printf "dbm_mldbm='%s'\n => require '%s'\n\n", $v, $ser_mod; prints the input value and the path that would be required, so you can see the result for each payload.

Running that over the traversal value produces:

Text
dbm_mldbm='../../../../tmp/evil_serializer'  => require 'MLDBM/Serializer/../../../../tmp/evil_serializer.pm'

The MLDBM::Serializer:: prefix sits at the front exactly as it should, and then the ../../../../ walks straight back out of it. The code is not tricked into producing this string; it builds it correctly, following its own rules, using a value nobody checked first.

Why there is no third proof of concept

The researcher did not build a separate proof for the third door, the assignment into $MLDBM::Serializer on every table read and write. Steps one to three already prove that an attacker-controlled string reaching a bare require in this codebase results in real code execution. The third door hands the same kind of string to the same underlying mechanism from a different variable, and more often. Once the lock is shown to be missing on the front door, there is no need to pick the side door to know it works the same way.

Root cause

The root cause is the underlying reason a bug exists, as opposed to the symptom you see. The validation in DBD::DBM is name-based only. dbm_type and dbm_mldbm are accepted because they appear in %dbm_valid_attrs, and their values are then used to build module names for require without any allow-list check. An allow-list is the opposite of a blocklist: instead of naming what is forbidden, it names exactly what is permitted and rejects everything else. In the dbm_mldbm path, the MLDBM::Serializer:: prefix and the s|::|/|g substitution look like containment, but the substitution only handles the :: sequence and leaves literal slashes and .. segments intact, so the constructed path can escape the intended directory. The third path skips the prefix entirely by writing the raw value into $MLDBM::Serializer, which MLDBM consults on every load and save. In all three cases the existing defence answers the wrong question: it confirms the attribute name is known, not that the value is safe.

Impact

Impact means who is affected and how badly. This is not a bug that lets a random stranger break into any Perl program that uses DBI. It matters wherever an application lets a less trusted source influence dbm_type or dbm_mldbm. That is narrower but real: a multi-tenant application (one service shared by many separate customers, each with their own space) that builds part of its connection string from user-submitted data, a config value inherited from a lower trust tier, or attributes relayed through DBI's Gofer proxy setup from a client. A proxy is a go-between that passes requests along, and Gofer is DBI's mechanism for doing that with database connections.

Anywhere one of those two values can be nudged by someone other than the developer, this is a path to code execution rather than a hypothetical. If you control the value, you control what module loads, and whatever sits at the top level of that module runs immediately. That is why the advisory rates it High, above the heap out-of-bounds write of the earlier CVE-2026-73194, which was serious but bounded and might have needed real effort to push further. A heap out-of-bounds write is a memory-safety flaw where a program writes past the end of a reserved block of memory; it can crash a program and sometimes be pushed further, but it is a different category from simply choosing which code runs.

Fix

The issue was reported with a full writeup and a working proof of concept straight to DBI's maintainer, handled by robrwo, and fixed without pushback. The maintainer is the person who looks after a project and decides what goes into it. The patch landed in DBI 1.653. A patch is a small change to the code that repairs a problem. In that release both attributes are checked against a list of known-safe values before anything gets loaded. If you use DBD::DBM and either attribute can be influenced by anything other than a value you hardcoded, upgrade to DBI 1.653 or later. If you cannot upgrade immediately, do not pass either attribute through from user input, config inherited from a less trusted layer, or anything relayed from a client connection: hardcode them, or check them yourself against a small allow-list before they reach DBI.

Glossary

  • Allow-list: a list of exactly what is permitted, with everything else rejected.
  • Arbitrary module load: making a program load and run a module chosen by someone other than the developer.
  • Attribute: a named setting passed to a program, like an option in a dialogue box.
  • Connection string: text describing where and how to connect to a database.
  • CVE: a public catalogue number given to a confirmed security flaw.
  • CWE-470: a classification for bugs where externally controlled input selects which classes or code run.
  • Database: an organised store of information a program can query.
  • DBD: Database Driver, the companion module that lets DBI talk to one specific kind of database.
  • DBD::DBM: the driver that talks to dbm files.
  • DBI: the Database Interface module for Perl, the middle layer between Perl code and a database.
  • dbm file: a simple key-value store format used in Perl for a long time.
  • Environment variable: a named setting the operating system passes to programs when they start.
  • File handle: a program's grip on an open file, used to read from or write to it.
  • Function: a named block of instructions inside a program.
  • Gofer: DBI's proxy mechanism for relaying database connections and their attributes.
  • Hash: a lookup table of key-and-value pairs.
  • Heap out-of-bounds write: a memory-safety flaw where a program writes past the end of a reserved block of memory.
  • High: a severity rating meaning the flaw is serious and should be fixed promptly.
  • Impact: who is affected by a bug and how badly.
  • @INC: Perl's list of folders it searches when loading modules.
  • Library / module: a bundle of ready-made instructions other programs borrow.
  • List / array: an ordered collection of values.
  • Loop: instructions repeated once for each item in a collection.
  • Maintainer: the person who looks after a project and decides what goes into it.
  • MLDBM: the layer that lets a dbm file store complex data structures.
  • Multi-tenant application: one service shared by many separate customers, each with their own space.
  • Package variable: a named box belonging to a library that other code can read and write.
  • Patch: a small change to code that repairs a problem.
  • Payload: the value an attacker sends to try to trigger a bug.
  • Perl: a programming language.
  • PID: process identifier, the number the operating system gives a running program.
  • Proof of concept: a small, safe demonstration that a bug is real.
  • Proxy: a go-between that passes requests along.
  • require: Perl's built-in instruction for loading a module by name.
  • Root cause: the underlying reason a bug exists, as opposed to the symptom.
  • Sentinel: a marker whose presence proves that some code ran.
  • Serializer: a converter that turns a data structure into bytes for storage and back again.
  • Source repository: the shared folder where a project's actual code and its history live.
  • Substitution: replacing one piece of text with another inside a string.
  • Top-level code: instructions in a module that run as soon as the file is loaded.
  • Variable: a named box in a program that holds a value.
  • Variant: a different place where the same kind of mistake might appear.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.