CVE-2021–35042 : Django QuerySet.order_by() SQL Injection
Django's QuerySet.order_by() accepted unsanitised user input in a deprecated code path, allowing SQL injection. An attacker could execute arbitrary SQL queries against the backend database without authentication or user interaction.
medium.com
Published on medium.com
Cybersecurity
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
CVE-2021-35042 is an SQL injection vulnerability in the Django web framework. It occurs when user input is passed without sanitisation into the QuerySet.order_by() function. The flaw lets an attacker execute arbitrary SQL queries against the backend database without authentication or user interaction. The root cause is a regression in column validation that appeared as a side effect of a fix for another bug, in a code path that was deprecated at the time.
The write-up is based on testing in a controlled lab environment and is intended for internal documentation, not for use against systems without explicit authorisation to test.
Setup
The affected function is only QuerySet.order_by(), not other Django ORM functions such as filter(), exclude() or annotate(). The gap appears specifically in the deprecated code path that skips the strict column reference validation that should normally apply.
Affected Django versions:
- Django 3.0.x and 3.1.x, all versions before 3.1.13
- Django 3.2.x, all versions before 3.2.5
Safe (patched) versions:
- Django 3.1.13 and above
- Django 3.2.5 and above
- Django 4.x and later, where the deprecated code path has been removed entirely
Preconditions for exploitation:
- The application passes user input (for example a query string parameter such as
?order=) directly intoorder_by()without a whitelist or column validation. - For the error-based extraction technique using
updatexml(),DEBUG = Truemust be active insettings.pyso that MySQL error messages are shown in the response. - The backend database must be MySQL for the specific
updatexml()/extractvalue()technique. Other injection techniques (union-based, blind time-based) may work across database backends depending on the syntax each one supports.
The commands below use port 8000 on the target.
Finding it
The normal behaviour of the ORM is to validate column names strictly, accepting only fields that actually exist on the model. In the deprecated path this validation can be bypassed when input comes straight from the user with no additional sanitisation from the application, so a string sent through an order parameter can reach a raw SQL clause without filtering.
A typical vulnerable pattern, described as a general representation rather than Django's own source code:
- The application reads the parameter from the request:
order = request.GET.get('order', 'name') - That value is used directly to build the SQL query, for example inside a structure like
ORDER BY (CASE WHEN (1=1) THEN {order} ELSE name END) - Because
1=1is always true, theTHENbranch containing the user input always executes without validation
Exploitation
Step 1: Fingerprinting Django
The goal is to confirm the target runs Django before further testing. Check the response headers:
curl -I "http://TARGET_IP:8000/PATH/"
Indicators to look for:
- A
Serverheader in the formWSGIServer/0.2 CPython/X.X.X - A cookie named
csrftoken - The header
X-Frame-Options: DENY - The header
X-Content-Type-Options: nosniff - The header
Referrer-Policy: same-origin - The combination of the three security headers above appearing together suggests Django's built-in
SecurityMiddleware, which other frameworks do not apply by default - A hidden
csrfmiddlewaretokenfield in any HTML form is the most reliable indicator, becauseCsrfViewMiddlewareinserts it automatically into every POST form
Step 2: Identifying the injection point
- Look through application pages that have a sorting feature (for example a product catalogue, article list or data table).
- Watch for query string parameters that appear to control the sort column, for example
?order=,?sort=,?order_by=. - Check whether the parameter appears in the HTML form as a hidden input or can be modified directly through the URL.
Step 3: Verifying the injection (database version extraction)
A payload for initial confirmation, using the error-based technique via updatexml():
curl -s "http://TARGET_IP:8000/PATH/?order=updatexml(1,concat(0x7e,(select%20@@version)),1)"
Extract the result from the response with pattern matching:
curl -s "http://TARGET_IP:8000/PATH/?order=updatexml(1,concat(0x7e,(select%20@@version)),1)" | grep -o '~[0-9][^&]*'
How the payload works:
updatexml(1, xpath_expr, 1)raises an error when the second argument is not a valid XPath expression.concat(0x7e, (select @@version))joins the delimiter character~(hex0x7e) with the result of the query to be extracted.- The combined string is not a valid XPath format, so MySQL throws an error that includes the string's contents.
- Because
DEBUG = True, Django displays the raw MySQL error message in the HTTP 500 response, so the query result can be read directly from the response body. - The
~prefix is used as a marker to make extraction with a regex easier, since this character rarely appears naturally in MySQL error messages.
The same error response also reveals the application's Django version (for example Django Version: 3.2.4), which is useful as additional confirmation that the version falls within the vulnerable range.
Step 4: Further enumeration
Extract the name of the active database:
curl -s "http://TARGET_IP:8000/PATH/?order=updatexml(1,concat(0x7e,(select%20database())),1)" | grep -o '~[0-9a-zA-Z_][^&]*'
Further steps once the gap is confirmed:
- Enumerate table and column names in the database using subqueries against
information_schema. - Extract sensitive data (user credentials, customer data, application configuration).
- Hand the identified vulnerable parameter and endpoint to Sqlmap to automate a full database dump, with options matching the error-based technique already confirmed to work.
Fallback when DEBUG = False
- The error-based technique above only works when
DEBUG = True. In a production environment withDEBUG = False, error responses are generalised with no detail. - Use blind time-based injection instead, using the
SLEEP()function to extract data character by character from differences in response time.
Root cause
Django's ORM normally validates strictly the column names used for sorting, ensuring only fields that actually exist on the model are accepted. A fix for another bug by the Django team introduced a regression as a side effect in the code path marked deprecated. In that deprecated path, column validation can be bypassed when input comes directly from the user without additional sanitisation on the application side. As a result, a string sent through the order parameter can enter the raw SQL clause without filtering.
The vulnerability was found and reported by the Django team itself through a coordinated disclosure process, then patched and published together on 1 July 2021.
Impact
Possible impact:
- Disclosure of sensitive information from the database (database name, table structure, data contents)
- Unauthorised manipulation or modification of data
- Potential for further escalation depending on the database configuration and the privileges of the database user the application uses
- Full compromise of the application's confidentiality, integrity and availability (based on the CVSS vector: AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H)
These outcomes depend on the preconditions above: user input reaching order_by() unfiltered, and, for the error-based technique specifically, DEBUG = True and a MySQL backend.
Fix
- Upgrade Django to version 3.1.13, 3.2.5 or a later version appropriate to the branch in use.
- Disable
DEBUG = Truein all production environments; make sure detailed error messages are never shown to end users. - Audit every endpoint that accepts sorting/filtering parameters from users to ensure no raw string is passed directly into
order_by().
Detection and indicators of compromise
The write-up also lists what to look for after the fact.
Access log patterns:
- Query string parameters containing SQL functions such as
updatexml,extractvalue,sleep(,benchmark(,union select,information_schema - Sorting parameters (
order,sort,order_byand similar naming variants) containing unusual characters such as parentheses, excessive commas or SQL keywords - A surge of repeated requests to the same endpoint with small payload variations on the same parameter, indicating manual or automated enumeration (for example the typical pattern of Sqlmap)
- Repeated HTTP 500 responses from the same source IP, especially if followed by follow-up requests with slightly modified payloads
Response/error patterns:
- MySQL error messages leaking into the response body of a production application indicate
DEBUG = Trueis active when it should not be. This is itself a critical misconfiguration finding, independent of whether active exploitation occurred. - Strings with an unusual delimiter pattern (such as the
~character followed by structured data) in an error response suggest an attempted error-based SQL injection.
SIEM or WAF query/rule recommendations:
- Block or alert on requests whose parameters contain the combination
updatexml,extractvalue,sleep(,benchmark(,union,select,information_schema, especially on parameters used for sorting/filtering - Apply rate limiting to endpoints that accept sorting parameters, to slow automated enumeration
- Audit application logs for requests with response times far above the normal baseline on sorting endpoints, as an indicator of possible blind time-based injection
Post-exploitation indicators:
- Unusual database queries in the database server log (if database logging is enabled), particularly queries with a
CASE WHENstructure that does not match the application's normal pattern - Access to tables that should not be relevant to the function of the accessed endpoint (for example a product catalogue endpoint suddenly accessing a user/credential table)
- Unusual outbound data volume (egress) from the application server, especially close in time to the suspicious request patterns above
Variants to test
What happened, in plain words
A web framework called Django had a bug that let an attacker slip their own database commands into a website through a feature that sorts lists. The feature is called QuerySet.order_by(), and it is the part of Django that decides the order of results, for example alphabetical by product name. If a website passed whatever a visitor typed straight into that sorting function, the visitor could add extra database instructions. The database would then run those instructions as if the website itself had asked for them.
The bug is catalogued as CVE-2021-35042. "CVE" is a public ID number given to a known security flaw so people can look it up. The flaw is an SQL injection: SQL is the language used to talk to databases, and injection means untrusted text gets mixed into a command instead of being treated as plain data. The attacker needs no account and no help from a logged-in user. The Django team found and reported the bug themselves, fixed it, and published the fix on 1 July 2021.

The image is the article's title card, labelled CVE-2021-35042.
This walkthrough is based on testing in a controlled lab environment. It is for internal documentation, not for use against systems you do not have explicit permission to test.
Setup
What Django and its ORM are
Django is a toolkit for building websites in the Python programming language. Most websites need to store and read data: products, articles, user accounts. That data lives in a database, and the part of Django that talks to the database is called the ORM, short for Object-Relational Mapper. The ORM lets a programmer write Python such as "give me all products sorted by name" and turns it into an SQL query behind the scenes. Think of the ORM as a translator sitting between your code and the database, so you never have to write SQL by hand.
The ORM offers several functions. filter() picks rows that match a condition, exclude() removes rows that match, annotate() adds calculated values, and order_by() sorts the results. Only order_by() is affected by this bug. The other functions are not.
Why only one function is affected
Normally the ORM is careful about sorting. It checks the column name you give it against the list of fields that actually exist on the model, and rejects anything else. A model is Django's description of a database table: which columns it has and what type each one holds. So if a model has a name column, order_by('name') is fine and order_by('secret_password') is refused.
The problem sits in a code path that Django had marked as deprecated. Deprecated means "still works for now, but scheduled for removal, do not build anything new on it". In that old path, the careful column check could be skipped. When a website took text straight from a visitor and handed it to order_by() without checking it first, the text reached the raw SQL without being filtered.
Which versions are affected
- Django 3.0.x and 3.1.x, every version before 3.1.13
- Django 3.2.x, every version before 3.2.5
Versions that are safe because they contain the fix:
- Django 3.1.13 and above
- Django 3.2.5 and above
- Django 4.x and later, where the deprecated code path has been removed entirely
What has to be true for an attack to work
- The website passes visitor input, for example a query string parameter such as
?order=, directly intoorder_by()with no whitelist and no column validation. A whitelist is a fixed list of allowed values; anything not on the list is refused. - For the specific technique used below, called error-based extraction with
updatexml(), the settingDEBUG = Truemust be active in the filesettings.py.DEBUGis Django's developer mode. When it is on, Django shows detailed error pages, including raw database error messages, to whoever triggers the error. That is helpful while building a site and dangerous once the site is live. - The database behind the site must be MySQL for the
updatexml()andextractvalue()technique. Other techniques, such as union-based or blind time-based injection, may work on other database systems depending on which syntax each one supports.
The commands below use port 8000 on the target. HTTP is the protocol your browser uses to fetch web pages. A port is a numbered door on a server; the standard web port is 80, and 8000 is a common choice for a development server.
Finding it
The reasoning is that the ORM is supposed to validate column names strictly, but the deprecated path can be bypassed when input arrives straight from the visitor with no extra sanitisation from the application. Sanitisation means cleaning or checking input before using it. Without it, a string sent through an order parameter can land in a raw SQL clause unfiltered.
A typical vulnerable pattern looks like this. The write-up presents it as a general representation, not as Django's own source code:
- The application reads the parameter from the request:
order = request.GET.get('order', 'name') - That value is used directly to build the SQL query, for example inside a structure like
ORDER BY (CASE WHEN (1=1) THEN {order} ELSE name END) - Because
1=1is always true, theTHENbranch containing the user input always executes without validation
In plain words: the first line takes whatever the visitor put in the order field of the URL and stores it in a variable, falling back to name if nothing was supplied. The second line drops that variable into the middle of an SQL statement. CASE WHEN is SQL's if-then construct: if the condition is true, use the first branch, otherwise use the second. Since 1=1 can never be false, the branch holding the visitor's text is always the one that runs, and nothing checks what that text contains.
Exploitation
Step 1: Fingerprinting Django
Fingerprinting means working out what software a site runs before attacking it. You would not pick a lock without knowing what kind of lock it is. The goal here is to confirm the target is Django before testing anything else. The tool used is curl, a command-line program that fetches a URL and prints the response. The -I flag asks for headers only, not the page body.
curl -I "http://TARGET_IP:8000/PATH/"
Line by line: curl is the program. -I tells it to send a HEAD request, which is like a GET request for a page but asks the server to return only the response headers. "http://TARGET_IP:8000/PATH/" is the address being checked, with TARGET_IP standing in for the lab machine's address and PATH for the page being tested. The quotes keep the shell from misreading the URL.
Headers are small pieces of information a server sends alongside a page: what software it runs, what type of content follows, and so on. Cookies are small pieces of data a site stores in your browser and gets back on every later request; they are how a site remembers who you are between page loads. Indicators to look for in the response:
- A
Serverheader in the formWSGIServer/0.2 CPython/X.X.X. WSGI is the standard way Python web applications talk to a web server, and CPython is the standard Python interpreter, so this header is a strong hint of a Python site. - A cookie named
csrftoken. CSRF stands for Cross-Site Request Forgery, an attack where another site tricks your browser into submitting a form you did not intend to submit. Django defends against it with a token, a random value tied to your session. - The header
X-Frame-Options: DENY, which stops other sites from embedding this site inside a frame. - The header
X-Content-Type-Options: nosniff, which stops browsers from guessing a file's type and possibly running it as something dangerous. - The header
Referrer-Policy: same-origin, which limits how much of the current address is shared with other sites. - The three security headers above appearing together suggest Django's built-in
SecurityMiddleware. Middleware is a layer that every request passes through, and other frameworks do not add these headers by default. - A hidden
csrfmiddlewaretokenfield in any HTML form is the most reliable indicator, becauseCsrfViewMiddlewareinserts it automatically into every form that submits with POST. A hidden field is one the visitor cannot see but the browser still sends. POST is the HTTP method used to submit data, as opposed to GET, which is used to request a page.
Step 2: Identifying the injection point
The injection point is the exact place where your text enters the database command. Finding it is the whole game, because without it there is nothing to inject into.
- Look through pages that have a sorting feature: a product catalogue, an article list, a data table.
- Watch for query string parameters that appear to control the sort column, for example
?order=,?sort=,?order_by=. The query string is the part of a URL after the question mark; it carries small pieces of data to the server. - Check whether the parameter appears in the HTML form as a hidden input, or whether it can be changed directly in the URL bar.
Step 3: Verifying the injection (database version extraction)
Now the researcher sends a payload. A payload is the crafted piece of input designed to make the target do something it should not. This one uses error-based injection: instead of trying to read data out of the page, it deliberately causes a database error whose message contains the data. The -s flag on curl silences the progress meter so only the response is printed.
curl -s "http://TARGET_IP:8000/PATH/?order=updatexml(1,concat(0x7e,(select%20@@version)),1)"
Line by line: curl -s fetches the URL quietly. The URL is the lab page with ?order= followed by the payload. updatexml is a MySQL function that normally edits part of an XML document; it takes three arguments. The first is 1, a placeholder document. The second is the expression that must be valid XPath, a language for pointing at parts of an XML document. The third is 1, the new value. concat glues strings together. 0x7e is the hexadecimal code for the tilde character ~. select @@version asks MySQL for its own version number. %20 is the URL encoding of a space, because spaces are not allowed raw in a URL. So the whole payload says: build the string ~ plus the database version, hand it to updatexml as an XPath expression, and let MySQL complain.
To pull the answer out of the response automatically, the researcher pipes the output into grep, a tool that prints only lines matching a pattern:
curl -s "http://TARGET_IP:8000/PATH/?order=updatexml(1,concat(0x7e,(select%20@@version)),1)" | grep -o '~[0-9][^&]*'
Line by line: everything before the | is the same request as above. The vertical bar | is a pipe: it takes the output of the command on the left and feeds it as input to the command on the right. grep -o prints only the matching part of each line, not the whole line. The pattern '~[0-9][^&]*' means: a tilde, then a digit, then any number of characters that are not an ampersand. The ampersand is excluded because in a URL it separates one parameter from the next, so stopping there avoids dragging in unrelated text.
How the payload works, step by step:
updatexml(1, xpath_expr, 1)raises an error when the second argument is not a valid XPath expression.concat(0x7e, (select @@version))joins the delimiter character~(hex0x7e) with the result of the query to be extracted.- The combined string is not valid XPath, so MySQL throws an error that includes the string's contents.
- Because
DEBUG = True, Django displays the raw MySQL error message in the HTTP 500 response, so the query result can be read directly from the response body. HTTP 500 is the status code for "server error". - The
~prefix is a marker that makes extraction with a regex easier, since this character rarely appears naturally in MySQL error messages. A regex, or regular expression, is a pattern for matching text.
The same error response also reveals the application's Django version, for example Django Version: 3.2.4. That is useful as extra confirmation that the version falls inside the vulnerable range.
Step 4: Further enumeration
Enumeration means listing things out one by one: first the database name, then its tables, then their columns, then the rows inside. The next payload swaps @@version for database(), a MySQL function that returns the name of the database currently in use.
curl -s "http://TARGET_IP:8000/PATH/?order=updatexml(1,concat(0x7e,(select%20database())),1)" | grep -o '~[0-9a-zA-Z_][^&]*'
Line by line: the request is the same shape as before, with database() in place of @@version. The grep pattern is slightly wider: ~[0-9a-zA-Z_][^&]* allows the first character after the tilde to be a digit, a letter or an underscore, because database names can start with any of those, unlike version numbers which start with a digit.
Once the gap is confirmed, further steps are possible:
- Enumerate table and column names using subqueries against
information_schema. A subquery is a query nested inside another query.information_schemais a built-in MySQL catalogue that describes every database, table and column on the server, which makes it a map of the whole system. - Extract sensitive data: user credentials, customer data, application configuration.
- Hand the identified vulnerable parameter and endpoint to Sqlmap to automate a full database dump, with options matching the error-based technique already confirmed to work. Sqlmap is a free tool that automates SQL injection testing and data extraction.
Fallback when DEBUG = False
- The error-based technique above only works when
DEBUG = True. In a production environment withDEBUG = False, error responses are generalised with no detail, so there is nothing to read. - Use blind time-based injection instead. Blind means you never see the data itself, only a side effect. The
SLEEP()function makes the database pause for a number of seconds. By asking the database questions whose answers change how long it sleeps, the attacker extracts data character by character from differences in response time. It is slow, like reading a book by asking yes or no questions about each letter, but it works without any error message.
Root cause
Django's ORM normally validates strictly the column names used for sorting, ensuring only fields that actually exist on the model are accepted. A fix for another bug by the Django team introduced a regression as a side effect in the code path marked deprecated. A regression is when a change meant to fix one thing accidentally breaks another. In that deprecated path, column validation can be bypassed when input comes directly from the user without additional sanitisation on the application side. As a result, a string sent through the order parameter can enter the raw SQL clause without filtering.
The vulnerability was found and reported by the Django team itself through a coordinated disclosure process, then patched and published together on 1 July 2021. Coordinated disclosure means the people who found a flaw tell the people who maintain the software privately, giving them time to fix it before the details go public.
Impact
Possible impact:
- Disclosure of sensitive information from the database: the database name, the table structure, the data contents.
- Unauthorised manipulation or modification of data.
- Potential for further escalation depending on the database configuration and the privileges of the database user the application uses. Privileges are the permissions a database account holds; a powerful account means more damage.
- Full compromise of the application's confidentiality, integrity and availability, based on the CVSS vector
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H. CVSS is a scoring system for the severity of a flaw. The vector is a compact string of its components: attack over the network, low complexity, no privileges required, no user interaction, scope unchanged, and high impact on confidentiality, integrity and availability. Confidentiality means keeping data secret, integrity means keeping it correct, availability means keeping the service running.
These outcomes depend on the preconditions above: user input reaching order_by() unfiltered, and, for the error-based technique specifically, DEBUG = True and a MySQL backend.
Fix
- Upgrade Django to version 3.1.13, 3.2.5 or a later version appropriate to the branch in use. A branch is a line of development, such as the 3.2 series.
- Disable
DEBUG = Truein all production environments; make sure detailed error messages are never shown to end users. - Audit every endpoint that accepts sorting or filtering parameters from users to ensure no raw string is passed directly into
order_by(). An endpoint is a specific address on a server that performs a specific job.
Detection and indicators of compromise
An indicator of compromise, or IOC, is a trace left behind that suggests an attack happened. The write-up lists what to look for after the fact.
Access log patterns. An access log is the record a web server keeps of every request it receives.
- Query string parameters containing SQL functions such as
updatexml,extractvalue,sleep(,benchmark(,union select,information_schema. - Sorting parameters (
order,sort,order_byand similar naming variants) containing unusual characters such as parentheses, excessive commas or SQL keywords. - A surge of repeated requests to the same endpoint with small payload variations on the same parameter, indicating manual or automated enumeration, for example the typical pattern of Sqlmap.
- Repeated HTTP 500 responses from the same source IP, especially if followed by follow-up requests with slightly modified payloads. An IP address is the numeric address of a machine on a network.
Response and error patterns:
- MySQL error messages leaking into the response body of a production application indicate
DEBUG = Trueis active when it should not be. This is itself a critical misconfiguration finding, independent of whether active exploitation occurred. A misconfiguration is a setting left in a dangerous state. - Strings with an unusual delimiter pattern, such as the
~character followed by structured data, in an error response suggest an attempted error-based SQL injection.
SIEM or WAF query and rule recommendations. A SIEM is a system that collects and correlates logs from many machines. A WAF is a web application firewall, a filter that sits in front of a site and inspects incoming requests.
- Block or alert on requests whose parameters contain the combination
updatexml,extractvalue,sleep(,benchmark(,union,select,information_schema, especially on parameters used for sorting or filtering. - Apply rate limiting to endpoints that accept sorting parameters, to slow automated enumeration. Rate limiting caps how many requests a client may make in a given time.
- Audit application logs for requests with response times far above the normal baseline on sorting endpoints, as an indicator of possible blind time-based injection.
Post-exploitation indicators:
- Unusual database queries in the database server log, if database logging is enabled, particularly queries with a
CASE WHENstructure that does not match the application's normal pattern. - Access to tables that should not be relevant to the function of the accessed endpoint, for example a product catalogue endpoint suddenly accessing a user or credential table.
- Unusual outbound data volume, called egress, from the application server, especially close in time to the suspicious request patterns above.
Variants to test
Glossary
- Access log: the record a web server keeps of every request it receives.
- API: a defined way for one piece of software to ask another for data or actions, like a menu of requests a program accepts.
- Blind injection: an attack where you cannot see the data directly and infer it from side effects such as timing.
- Branch: a line of development of a software project, such as the 3.2 series.
- Cookie: a small piece of data a site stores in your browser and receives back on later requests, used to remember you.
- Coordinated disclosure: reporting a flaw privately to the maintainers so they can fix it before details go public.
- CSRF: Cross-Site Request Forgery, an attack that tricks your browser into submitting a request you did not intend.
- CSRF token: a random value tied to your session that proves a form submission came from the site itself.
- CVSS: a scoring system for the severity of a security flaw.
- CVE: a public ID number assigned to a known security flaw.
- Deprecated: still working for now but scheduled for removal, not to be used for anything new.
- Django: a toolkit for building websites in Python.
- Egress: data leaving a network or server.
- Endpoint: a specific address on a server that performs a specific job.
- Enumeration: listing things out one by one, such as databases, tables and columns.
- Error-based injection: an attack that deliberately causes a database error whose message contains the data being extracted.
- Fingerprinting: working out what software and versions a target runs.
- grep: a command-line tool that prints only the lines, or parts of lines, matching a pattern.
- Header: a small piece of information a server sends alongside a page, such as the software it runs.
- HTTP: the protocol browsers and servers use to exchange web pages and data.
- HTTP 500: the status code meaning the server hit an error while handling the request.
- Indicator of compromise (IOC): a trace that suggests an attack happened.
- Injection: mixing untrusted text into a command so it is treated as instructions rather than data.
information_schema: a built-in MySQL catalogue describing every database, table and column on the server.- Middleware: a layer that every request passes through before reaching the application.
- Misconfiguration: a setting left in a dangerous state.
- Model: Django's description of a database table, listing its columns and their types.
- MySQL: a popular open-source database system.
- ORM: Object-Relational Mapper, the part of a framework that translates code into database queries.
- Payload: the crafted input designed to make a target do something it should not.
- Pipe: the
|symbol that feeds the output of one command into another. - Port: a numbered door on a server that a service listens on.
- POST: the HTTP method used to submit data to a server, as opposed to GET which requests a page.
- Privileges: the permissions a database account holds.
- Query string: the part of a URL after the question mark that carries small pieces of data.
- Rate limiting: capping how many requests a client may make in a given time.
- Regex: a pattern for matching text.
- Regression: when a change meant to fix one thing accidentally breaks another.
- Sanitisation: cleaning or checking input before using it.
- SIEM: a system that collects and correlates logs from many machines.
- Sqlmap: a free tool that automates SQL injection testing and data extraction.
- SQL: the language used to talk to relational databases.
- SQL injection: mixing untrusted text into an SQL command so it runs as instructions.
- Subquery: a query nested inside another query.
- Union-based injection: appending a second query to the first so its results appear on the page.
- WAF: web application firewall, a filter in front of a site that inspects incoming requests.
- Whitelist: a fixed list of allowed values; anything not on the list is refused.
- WSGI: the standard way Python web applications talk to a web server.
- XPath: a language for pointing at parts of an XML document.