How I Broke An Invoicing App: The Story of My First CVE
An authenticated SQL injection in InvoicePlane's tax rate decimal places setting allowed an admin to inject DDL statements, deleting a database column and causing a persistent denial of service. The attacker could destroy the database structure, requiring manual repair.
Published on medium.com
Cve
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.
Context
InvoicePlane is an open-source invoicing application used to manage money, and the target of this research was its Settings module. Within Settings, the Tax section exposes a dropdown labelled tax_rate_decimal_places, which controls how many decimal places are stored for tax rate percentages. In the normal interface the dropdown offers only two choices, 2 and 3.

The dropdown is not cosmetic: the selected value is used to alter the structure of the ip_tax_rates table, so the setting has a direct effect on the database schema rather than only on how numbers are displayed.
Setup
The write-up describes the finding as an authenticated issue: the researcher needed admin access to perform the attack. The only tool named is Burp Suite, used to intercept the request before it reached the server. No specific InvoicePlane version, account setup details or hosting environment are given.
Finding it
The starting point was a simple observation: a dropdown that only allows 2 or 3 is a client-side restriction, and the server may accept anything that is sent to it. The researcher's guiding rule here is that the frontend is a lie: a list of choices in the browser does not mean the server validates the value against that list.
Looking at the backend code confirmed the suspicion. The relevant code looked like this:
ALTER TABLE `ip_tax_rates` CHANGE `tax_rate_percent` ... DECIMAL( 5, {$settings['tax_rate_decimal_places']} )
The value from the dropdown is interpolated directly into an ALTER TABLE statement that changes the column definition of tax_rate_percent. There is no validation and no second check before the value reaches the database.

Exploitation
Step 1: intercept the settings request
With Burp Suite in place, the researcher captured the request generated when saving the tax decimal places setting, before it reached the server.
Step 2: replace the dropdown value
The value 2 taken from the dropdown was replaced with the following payload:
2) NOT NULL, DROP COLUMN tax_rate_name --
The payload closes the DECIMAL( 5, ... ) definition with ), adds NOT NULL to the column definition, then appends a second DDL clause, DROP COLUMN tax_rate_name, and comments out the remainder of the original statement with --. Because the value is placed inside an ALTER TABLE ... CHANGE statement, the injected clause is executed as part of the same schema change.
Step 3: save and observe
The server accepted the value without complaint and executed the resulting statement. In effect it changed the decimal places to 2 and, in the same statement, deleted the column that stores the names of all the tax rates.

The outcome was that the tax_rate_name column disappeared, the database was left broken, and the application began throwing fatal errors and crashed. The researcher describes this as a Persistent Denial of Service: the only recovery was for a developer to go into the database manually and rebuild the table from scratch.
Root cause
The application takes the tax_rate_decimal_places setting and interpolates it straight into an ALTER TABLE statement without casting or validating it. The dropdown constrains the value only in the browser; the server trusts whatever it receives. Because the injection point sits inside a DDL statement, the attacker is not limited to reading data: they can rewrite the schema. The write-up points to the missing conversion, such as $decimal_places = (int) $input, as the flaw.
Impact
This is an authenticated issue: the researcher needed admin access to reach the setting. Within that precondition, a single request can destroy part of the database schema and take the whole application down, and recovery requires manual database work by a developer. The write-up refers to this as CVE-2026-33639 and links to a proof-of-concept repository and the MITRE and NIST entries for the full exploit code, reproduction steps and official status.
Fix
The write-up does not describe a patch being applied. The write-up does not describe a patch. It notes that the developers forgot to turn the text into a number, for example with $decimal_places = (int) $input.
Variants to test
- Other numeric settings that shape schema or queries. Look for settings such as decimal places, precision, limits or lengths that are interpolated into DDL or SQL. A positive result is a value that changes the statement's structure, for example by closing a parenthesis or adding a clause, and is accepted by the server.
- Dropdowns and other enumerated inputs. Anywhere the UI restricts a value to a small list, intercept the request and send a value outside the list. A positive result is the server acting on the out-of-list value rather than rejecting it.
- DDL injection points specifically. Where a setting feeds an
ALTER TABLEor similar statement, try appending an additional clause and a comment. A positive result is a schema change beyond the intended one, such as a dropped or altered column. - Recovery behaviour. After a destructive change, check whether the application detects and repairs the broken schema, or crashes as it did here. A positive result for the attacker is a persistent outage that needs manual intervention.
What happened, in plain words
A security researcher found a way to break an invoicing application called InvoicePlane with a single request. InvoicePlane is open-source software, which means its code is public and anyone can install it to manage invoices, tax rates and other money-related records. The researcher had administrator access to the application, went into its Settings area, and found a small dropdown menu in the Tax section. That dropdown was supposed to let the administrator choose how many decimal places tax rates are stored with, and it offered only two choices: 2 or 3.
The researcher changed the value that the browser sent from 2 to a longer piece of text. The server accepted it without complaint and ran it as part of a database command. The result was that a column of the database was deleted, the application crashed, and the only way back was for a developer to repair the database by hand. The researcher describes this as a persistent denial of service: the application stays broken until someone fixes it manually.
The bug was published as CVE-2026-33639. A CVE is a public catalogue entry for a known security flaw, so that everyone can refer to the same issue by the same name. The researcher refers to it as a High CVE.
The pieces you need to know first
Before the steps make sense, here are the few ideas the whole story rests on.
- A web application is a program that runs on a server somewhere else and that you use through your browser. When you click Save, your browser sends a message to that server, and the server decides what to do.
- A database is where such an application keeps its records: customers, invoices, tax rates. Think of it as a set of spreadsheets with strict rules. Each spreadsheet is a table, each row is one record, and each column is one kind of information, for example the name of a tax rate.
- SQL is the language used to talk to those databases. You can use it to read rows, add rows, or change the shape of a table itself.
- DDL stands for Data Definition Language. It is the part of SQL that changes the shape of the database, such as adding or removing a column, as opposed to the part that only reads or writes data inside existing columns.
- A request is the message your browser sends to the server, for example when you press Save. It contains the address of the page, the values you filled in, and often a cookie, which is a small piece of data the server gave your browser earlier so it can recognise you on the next request. If you are logged in, the cookie is what proves it.
- Burp Suite is a tool that sits between your browser and the server. It lets you pause a request on its way out, look at it, change it, and then send it on. It is how you send a value the browser's interface would never let you type.
- SQL injection is a whole family of bugs. It happens when an application takes something a user supplied and glues it into a database command as if it were part of the command itself. The user's text is then read by the database as instructions rather than as a value. A simple comparison: imagine a form that asks for your name, and the clerk writes it into a sentence that is then read out as an order. If you write your name as "Bob, and also cancel all orders", the sentence now contains an order nobody intended.
- DDL injection is the same idea, but the command being built is one that changes the shape of the database. So the attacker is not limited to reading data: they can rewrite the structure.
- A denial of service means making a system unusable rather than stealing from it. It is persistent when the system stays broken after the attack stops, instead of recovering on its own.
The curiosity phase: a dropdown that offers only 2 and 3
The researcher was exploring the Settings module of InvoicePlane. Settings is the part of an application where an administrator configures how it behaves. Inside Settings, the Tax section holds options about tax rates, which are the percentages an invoice applies on top of a price.
There, the researcher noticed a dropdown labelled tax_rate_decimal_places. The label means: how many digits after the decimal point should be kept when storing a tax rate percentage. The dropdown offered only two choices, 2 and 3.

Most people would pick one and move on. The researcher applied a rule that is worth remembering: the frontend is a lie. The frontend is everything you see and click in the browser. A dropdown is just a list drawn on your screen; it does not force anything. When you press Save, your browser sends a message to the server, and nothing stops a curious person from changing that message before it leaves. The only question that matters is whether the server checks the value again on its own side. If it does not, the dropdown is decoration.
This is why the researcher did not stop at the dropdown. The next step was to find out what the server actually does with the number.
Digging into the code: the number goes straight into a database command
InvoicePlane is open-source, so its code can be read. The researcher looked at the backend, the part that runs on the server, and found the code that handles this setting. It looked like this:
ALTER TABLE `ip_tax_rates` CHANGE `tax_rate_percent` ... DECIMAL( 5, {$settings['tax_rate_decimal_places']} )
Line by line, in plain words:
ALTER TABLEis a DDL command. It means "change the shape of a table".`ip_tax_rates`is the name of the table being changed. It is the table that stores tax rates.CHANGEsays which column is being redefined, here`tax_rate_percent`, the column holding the percentage of each tax rate....stands for the rest of the column definition, which the write-up does not show.DECIMAL( 5, ... )is the new type of that column: a decimal number with a total of 5 digits, and a certain number of digits after the point.{$settings['tax_rate_decimal_places']}is the dangerous part. It is the value from the dropdown, inserted into the command as raw text. The application does not check it, does not convert it to a number, and does not compare it against the list of allowed choices.
So the setting is not cosmetic. It does not merely change how numbers are displayed on screen; it changes the actual structure of the database table. That is why the researcher's heart jumped: the value from a dropdown ends up inside a command that reshapes the database, with no safety net.

The "Aha!" moment: this is DDL injection
At this point the researcher realised this was not an ordinary SQL injection. An ordinary SQL injection usually lets an attacker read data they should not see, such as other people's records. Here the injection point sits inside a DDL statement, the kind that changes the shape of the database. That means the attacker can do more than read: they can rewrite the structure itself.

Exploitation, step by step
Step 1: intercept the settings request
The researcher opened Burp Suite and used it to catch the request that the browser sends when the tax decimal places setting is saved, before that request reached the server. Catching it first is the whole point: once it is on its way, you cannot change it, and the browser's own interface will not let you type anything except 2 or 3.
Step 2: replace the dropdown value
The value 2 coming from the dropdown was replaced with this payload:
2) NOT NULL, DROP COLUMN tax_rate_name --
What each part does, in plain words:
2is the harmless number the application expects. It is kept at the start so the beginning of the original command still looks normal.)closes theDECIMAL( 5, ... )definition early. The database now thinks the column type has been fully described.NOT NULLadds a rule to the column definition: the column may not be empty. It is there to keep the command syntactically valid after the closing bracket.,starts a new clause in the same command.DROP COLUMN tax_rate_nameis the second instruction, and the harmful one.DROP COLUMNmeans "delete this column".tax_rate_nameis the column that stores the names of all the tax rates.--starts a comment in SQL. Everything after it is ignored by the database. It is used to neutralise whatever was left of the original command after the insertion point, so the leftover text does not cause a syntax error.
Because the value is placed inside an ALTER TABLE ... CHANGE statement, the extra clause is not treated as data. It is executed as part of the same schema change.
Step 3: save and observe
The server accepted the value without complaint and ran the resulting statement. In effect, it changed the decimal places to 2 and, in the same statement, deleted the column that stores the names of all the tax rates.
The outcome was that the tax_rate_name column disappeared, the database was left broken, and the application began throwing fatal errors and crashed. The researcher describes this as a persistent denial of service: the only recovery was for a developer to go into the database manually and rebuild the table from scratch.
Why it worked: the root cause
The application takes the tax_rate_decimal_places setting and puts it straight into an ALTER TABLE statement, without converting it to a number and without checking it against the allowed values. The dropdown restricts the value only in the browser. The server trusts whatever it receives.
Because the injection point sits inside a DDL statement, the attacker is not limited to reading data: they can rewrite the schema. The write-up points to the missing conversion, such as $decimal_places = (int) $input, as the flaw. In plain words, (int) means "treat this as a whole number". If the value is forced to be a number before it reaches the command, then text like ) NOT NULL, DROP COLUMN ... cannot survive: it is no longer text at all.
Impact: what an attacker could do
This is an authenticated issue: the researcher needed administrator access to reach the setting. That precondition matters, and it is worth being honest about it. But within that precondition, a single request can destroy part of the database schema and take the whole application down, and recovery requires manual database work by a developer.
The write-up refers to this as CVE-2026-33639 and links to a proof-of-concept repository and the MITRE and NIST entries for the full exploit code, reproduction steps and official status.
The fix
The write-up does not describe a patch being applied. It notes that the developers forgot to turn the text into a number, for example with $decimal_places = (int) $input.
The lesson

Most people think SQL injection is only about stealing passwords. This bug shows that some injections are about destruction. By forgetting to turn a piece of text into a number, the developers left the keys to the kingdom under the doormat.
Variants to test
Each one describes what to try and what a positive result looks like.
- Other numeric settings that shape schema or queries. Look for settings such as decimal places, precision, limits or lengths that are inserted into DDL or SQL. A positive result is a value that changes the structure of the statement, for example by closing a parenthesis or adding a clause, and is accepted by the server.
- Dropdowns and other enumerated inputs. Anywhere the interface restricts a value to a small list, intercept the request and send a value outside the list. A positive result is the server acting on the out-of-list value rather than rejecting it.
- DDL injection points specifically. Where a setting feeds an
ALTER TABLEor similar statement, try appending an additional clause and a comment. A positive result is a schema change beyond the intended one, such as a dropped or altered column. - Recovery behaviour. After a destructive change, check whether the application detects and repairs the broken schema, or crashes as it did here. A positive result for the attacker is a persistent outage that needs manual intervention.
Glossary
- API: a defined way for one program to talk to another, for example a browser asking a server to save a setting.
- Authenticated: requiring you to be logged in, usually with a particular level of access, before you can perform an action.
- Backend: the part of an application that runs on the server, as opposed to the frontend that runs in your browser.
- Burp Suite: a tool that sits between your browser and a server so you can pause, inspect and modify requests before they are sent.
- Cookie: a small piece of data a server gives your browser so it can recognise you on later requests, often used to keep you logged in.
- CVE: a public catalogue entry with a unique number for a known security vulnerability, so everyone can refer to the same issue.
- Database: an organised store of records, made of tables with rows and columns.
- Database schema: the structure of a database: which tables exist, which columns they have and what type each column holds.
- DDL (Data Definition Language): the part of SQL that changes the shape of a database, such as adding or dropping a column.
- DDL injection: a SQL injection where the attacker's text becomes part of a DDL command, letting them change the database structure rather than just read data.
- Denial of service: making a system unusable, rather than stealing from it.
- Dropdown: a user interface control that lets you pick one value from a short list.
- Enumerated input: an input that is supposed to accept only a fixed set of values.
- Frontend: everything you see and interact with in the browser.
- Integer: a whole number, with no decimal part.
- Interpolation: inserting a value into a piece of text, here into a database command, so that the value becomes part of the command.
- Open-source: software whose code is publicly available for anyone to read and install.
- Payload: the crafted value an attacker sends in place of a normal one.
- Persistent denial of service: an outage that continues after the attack stops and needs manual repair.
- Proof of concept (PoC): code or steps that demonstrate a vulnerability actually works.
- Request: the message your browser sends to a server, for example when you press Save.
- Root cause: the underlying reason a vulnerability exists, as opposed to its symptoms.
- SQL: the language used to read and change data in a database.
- Table: a set of records in a database, organised in rows and columns.
- Validation: checking that a value is acceptable before using it.
- Vulnerability: a weakness in software that someone can abuse to make it behave in a way its authors did not intend.