Commit Graph

13444 Commits

Author SHA1 Message Date
Jacob Walls
e0896dfe83 [4.2.x] Added CVE-2025-13473, CVE-2025-14550, CVE-2026-1207, CVE-2026-1285, CVE-2026-1287, and CVE-2026-1312 to security archive.
Backport of af361d3be4 from main.
2026-02-03 09:12:15 -05:00
Jacob Walls
90f5b10784 [4.2.x] Fixed CVE-2026-1312 -- Protected order_by() from SQL injection via aliases with periods.
Before, `order_by()` treated a period in a field name as a sign that it
was requested via `.extra(order_by=...)` and thus should be passed
through as raw table and column names, even if `extra()` was not used.
Since periods are permitted in aliases, this meant user-controlled
aliases could force the `order_by()` clause to resolve to a raw table
and column pair instead of the actual target field for the alias.

In practice, only `FilteredRelation` was affected, as the other
expressions we tested, e.g. `F`, aggressively optimize away the ordering
expressions into ordinal positions, e.g. ORDER BY 2, instead of ORDER BY
"table".column.

Thanks Solomon Kebede for the report, and Simon Charette and Jake Howard
for reviews.

Backport of 69065ca869 from main.
2026-02-03 08:26:22 -05:00
Jake Howard
f75f8f3597 [4.2.x] Fixed CVE-2026-1287 -- Protected against SQL injection in column aliases via control characters.
Control characters in FilteredRelation column aliases could be used for
SQL injection attacks. This affected QuerySet.annotate(), aggregate(),
extra(), values(), values_list(), and alias() when using dictionary
expansion with **kwargs.

Thanks Solomon Kebede for the report, and Simon Charette, Jacob Walls,
and Natalia Bidart for reviews.

Backport of e891a84c7e from main.
2026-02-03 08:25:58 -05:00
Natalia
b40cfc6052 [4.2.x] Fixed CVE-2026-1285 -- Mitigated potential DoS in django.utils.text.Truncator for HTML input.
The `TruncateHTMLParser` used `deque.remove()` to remove tags from the
stack when processing end tags. With crafted input containing many
unmatched end tags, this caused repeated full scans of the tag stack,
leading to quadratic time complexity.

The fix uses LIFO semantics, only removing a tag from the stack when it
matches the most recently opened tag. This avoids linear scans for
unmatched end tags and reduces complexity to linear time.

Refs #30686 and 6ee37ada32.

Thanks Seokchan Yoon for the report.

Backport of a33540b3e2 from main.
2026-02-03 08:25:31 -05:00
Jacob Walls
a14363102d [4.2.x] Fixed CVE-2026-1207 -- Prevented SQL injections in RasterField lookups via band index.
Thanks Tarek Nakkouch for the report, and Simon Charette for the initial
triage and review.

Backport of 81aa529296 from main.
2026-02-03 08:25:13 -05:00
Jake Howard
f578acc8c5 [4.2.x] Fixed CVE-2025-14550 -- Optimized repeated header parsing in ASGI requests.
Thanks Jiyong Yang for the report, and Natalia Bidart, Jacob Walls, and
Shai Berger for reviews.

Backport of eb22e1d6d6 from main.
2026-02-03 08:24:42 -05:00
Jake Howard
6dc23508f3 [4.2.x] Fixed CVE-2025-13473 -- Standardized timing of check_password() in mod_wsgi auth handler.
Refs CVE-2024-39329, #20760.

Thanks Stackered for the report, and Jacob Walls and Markus Holtermann
for the reviews.

Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>

Backport of 3eb814e02a from main.
2026-02-03 08:24:15 -05:00
Jacob Walls
4a439c65aa [4.2.x] Added stub release notes and release date for 4.2.28.
Backport of b30e09a942 from main.
2026-01-27 15:34:30 -05:00
Natalia
10d1d2c55e [4.2.x] Added CVE-2025-13372 and CVE-2025-64460 to security archive.
Backport of d0d596042e from main.
2025-12-02 11:36:11 -03:00
Shai Berger
4d2b8803be [4.2.x] Fixed CVE-2025-64460 -- Corrected quadratic inner text accumulation in XML serializer.
Previously, `getInnerText()` recursively used `list.extend()` on strings,
which added each character from child nodes as a separate list element.
On deeply nested XML content, this caused the overall deserialization
work to grow quadratically with input size, potentially allowing
disproportionate CPU consumption for crafted XML.

The fix separates collection of inner texts from joining them, so that
each subtree is joined only once, reducing the complexity to linear in
the size of the input. These changes also include a mitigation for a
xml.dom.minidom performance issue.

Thanks Seokchan Yoon (https://ch4n3.kr/) for report.

Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>
Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>

Backport of 50efb718b3 from main.
2025-12-02 09:44:40 -03:00
Jacob Walls
f997037b23 [4.2.x] Fixed CVE-2025-13372 -- Protected FilteredRelation against SQL injection in column aliases on PostgreSQL.
Follow-up to CVE-2025-57833.

Thanks Stackered for the report, and Simon Charette and Mariusz Felisiak
for the reviews.

Backport of 5b90ca1e75 from main.
2025-12-02 09:44:19 -03:00
Natalia
0e85bdbde1 [4.2.x] Refs #36743 -- Added missing release notes for 5.1.15 and 4.2.27.
The fix landed in a8cf8c292c will be
backported to 5.1 and 4.2 since the 2048 limit was rolled out as part of
the security release for CVE-2025-64458.

Backport of 18b13cf6c4 from main.
2025-11-26 20:04:08 -03:00
Natalia
b40c057c25 [4.2.x] Added stub release notes and release date for 4.2.27.
Backport of d62e811acf from main.
2025-11-25 15:21:18 -03:00
Jacob Walls
0f4d5303a2 [4.2.x] Added GitHub Actions linter (zizmor).
At the direction of the Security Team. Thanks Markus Holtermann,
Jake Howard, and Natalia Bidart for reviews.

Backport of 09d4bf5cd9 from main.
2025-11-21 14:59:53 -05:00
Natalia
d2a414b56f [4.2.x] Added CVE-2025-64458 and CVE-2025-64459 to security archive.
Backport of c5a107e824 from main.
2025-11-05 11:19:21 -03:00
Jacob Walls
59ae82e670 [4.2.x] Fixed CVE-2025-64459 -- Prevented SQL injections in Q/QuerySet via the _connector kwarg.
Thanks cyberstan for the report, Sarah Boyce, Adam Johnson, Simon
Charette, and Jake Howard for the reviews.

Backport of c880530ddd from main.
2025-11-05 09:53:18 -03:00
Jacob Walls
770eea38d7 [4.2.x] Fixed CVE-2025-64458 -- Mitigated potential DoS in HttpResponseRedirect/HttpResponsePermanentRedirect on Windows.
Thanks Seokchan Yoon for the report, Markus Holtermann for the
triage, and Jake Howard for the review.

Backport of c880530ddd from main.
2025-11-05 09:52:56 -03:00
Jacob Walls
1b50da7e94 [4.2.x] Added stub release notes and release date for 4.2.26.
Backport of ab108bf94d from main.
2025-10-29 15:04:55 -03:00
Mariusz Felisiak
0f6ee3ebfa [4.2.x] Rewrapped security archive at 79 chars.
Backport of 1499c95d99 from main.
2025-10-01 16:25:51 -04:00
Jacob Walls
7bda200f6e [4.2.x] Added CVE-2025-59681 and CVE-2025-59682 to security archive.
Backport of 43d84aef04 from main.
2025-10-01 10:40:25 -04:00
Sarah Boyce
9504bbaa39 [4.2.x] Fixed CVE-2025-59682 -- Fixed potential partial directory-traversal via archive.extract().
Thanks stackered for the report.

Follow up to 05413afa8c.

Backport of 924a0c092e from main.
2025-10-01 09:06:00 -04:00
Mariusz Felisiak
38d9ef8c7b [4.2.x] Fixed CVE-2025-59681 -- Protected QuerySet.annotate(), alias(), aggregate(), and extra() against SQL injection in column aliases on MySQL/MariaDB.
Thanks sw0rd1ight for the report.

Follow up to 93cae5cb2f.

Backport of 41b43c74bd from main.
2025-10-01 09:05:20 -04:00
Mariusz Felisiak
7c7d2a4a10 [4.2.x] Added stub release notes and release date for 4.2.25.
Backport of 00174507f8 from main.
2025-09-24 11:48:20 -04:00
Mariusz Felisiak
3e27d614dd [4.2.x] Added missing backticks in docs/releases/security.txt.
Backport of 686a8a62ae from main
2025-09-04 11:11:25 +02:00
Sarah Boyce
07e5fb9f56 [4.2.x] Added CVE-2025-57833 to security archive.
Backport of f0c05a40d2 from main.
2025-09-03 15:30:45 +02:00
Jake Howard
31334e6965 [4.2.x] Fixed CVE-2025-57833 -- Protected FilteredRelation against SQL injection in column aliases.
Thanks Eyal Gabay (EyalSec) for the report.

Backport of 5171171709 from main.
2025-09-03 13:39:26 +02:00
Sarah Boyce
d5860d55eb [4.2.x] Added stub release notes and release date for 4.2.24.
Backport of 4c71e33440 from main.
2025-08-27 16:13:26 +02:00
Natalia
7335a1a913 [4.2.x] Refs #36535 -- Doc'd that docutils < 0.22 is required.
Backport of 9d9b3bc717 from stable/5.1.x.
2025-08-04 22:07:14 -03:00
Sarah Boyce
8293b0f52d [4.2.x] Added follow-up to CVE-2025-48432 to security archive.
Backport of 2714bc3f2c from main.
2025-06-10 15:16:20 +02:00
Jake Howard
b597d46bb1 [4.2.x] Refs CVE-2025-48432 -- Prevented log injection in remaining response logging.
Migrated remaining response-related logging to use the `log_response()`
helper to avoid potential log injection, to ensure untrusted values like
request paths are safely escaped.

Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>

Backport of 9579517552 from main.
2025-06-06 09:24:47 -03:00
Natalia
b07f886af7 [4.2.x] Added CVE-2025-48432 to security archive.
Backport of 51923c576a from main.
2025-06-04 10:58:57 -03:00
Natalia
ac03c5e7df [4.2.x] Fixed CVE-2025-48432 -- Escaped formatting arguments in log_response().
Suitably crafted requests containing a CRLF sequence in the request
path may have allowed log injection, potentially corrupting log files,
obscuring other attacks, misleading log post-processing tools, or
forging log entries.

To mitigate this, all positional formatting arguments passed to the
logger are now escaped using "unicode_escape" encoding.

Thanks to Seokchan Yoon (https://ch4n3.kr/) for the report.

Co-authored-by: Carlton Gibson <carlton@noumenal.es>
Co-authored-by: Jake Howard <git@theorangeone.net>

Backport of a07ebec559 from main.
2025-06-04 08:50:05 -03:00
Natalia
c62f4eeda7 [4.2.x] Added stub release notes and release date for 4.2.22.
Backport of 1a74434399 from main.
2025-05-28 10:21:44 -03:00
Jason Judkins
c5b42632c9 [4.2.x] Fixed #36402, Refs #35980 -- Updated built package name in reusable apps tutorial for PEP 625.
Backport of 1307b8a1cb from main.
2025-05-26 12:38:29 -03:00
Natalia
dc365cac9b [4.2.x] Refs #35980 -- Added release note about changes in release artifacts filenames.
Backport of 42ab99309d from main.
2025-05-09 13:33:55 -03:00
Natalia
c454afbf4c [4.2.x] Removed "Expected" from release date for 4.2.21.
Backport of c86156378d from main.
2025-05-09 13:33:08 -03:00
Natalia
5b29315848 [4.2.x] Cleaned up CVE-2025-32873 security archive description.
Backport of 37f2a77c72 from main.
2025-05-07 11:38:00 -03:00
Natalia
0d5495850a [4.2.x] Added CVE-2025-32873 to security archive.
Backport of fdabda4e05 from main.
2025-05-07 11:25:04 -03:00
Sarah Boyce
9cd8028f3e [4.2.x] Fixed CVE-2025-32873 -- Mitigated potential DoS in strip_tags().
Thanks to Elias Myllymäki for the report, and Shai Berger and Jake
Howard for the reviews.

Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>

Backport of 9f3419b519 from main.
2025-05-06 22:36:15 -03:00
Claude Paroz
ca31ca09f7 [4.2.x] Changed packing recommendation to use pyproject.toml in reusable apps docs.
Backport of f71bcc001b from main.
2025-05-05 11:46:49 -03:00
Claude Paroz
afe52d89c4 [4.2.x] Migrated setuptools configuration to pyproject.toml.
This branch migrates setuptools configuration from setup.py/setup.cfg to
pyproject.toml. In order to ensure that the generated binary files have
consistent casing (both the tarball and the wheel), setuptools version
is limited to ">=61.0.0,<69.3.0".

Configuration for flake8 was moved to a dedicated .flake8 file since
it cannot be configured via pyproject.toml.

Also, __pycache__ exclusion was removed from MANIFEST and the
extras/Makefile was replaced with a simpler build command.

Co-authored-by: Nick Pope <nick@nickpope.me.uk>

Backport of 4686541691 from main.
2025-05-05 11:46:49 -03:00
Natalia
93973d4f88 [4.2.x] Added upcoming security release to release notes.
Backport of 0f5dd0dff3 from main.
2025-04-30 14:58:52 -03:00
nessita
b3df753399 [4.2.x] Refs #36341 -- Added release note for 4.2.21 for fix in wordwrap template filter.
Revision 1e9db35836 fixed a regression in
55d89e25f4, which also needs to be
backported to the stable branches in extended support.

Backport of c86242d61f from main.
2025-04-23 17:35:28 -03:00
Sarah Boyce
318c16d2b8 [4.2.x] Fixed #36298 -- Truncated the overwritten file content in file_move_safe().
Regression in 58cd4902a7.

Thanks Baptiste Mispelon for the report.

Backport of 8ad3e80e88 from main.
2025-04-07 16:17:50 +02:00
Sarah Boyce
506cf74b0a [4.2.x] Added CVE-2025-26699 to security archive.
Backport of bad1a18ff2 from main.
2025-03-06 14:09:31 +01:00
Sarah Boyce
e88f7376fe [4.2.x] Fixed CVE-2025-26699 -- Mitigated potential DoS in wordwrap template filter.
Thanks sw0rd1ight for the report.

Backport of 55d89e25f4 from main.
2025-03-06 10:01:44 +01:00
Sarah Boyce
348e46a3e0 [4.2.x] Added stub release notes and release date for 4.2.20.
Backport of ea1e3703be from main.
2025-02-27 16:14:34 +01:00
Natalia
83231cca9c [4.2.x] Added release date for 4.2.19.
Backport of 294cc965ef from main.
2025-02-05 10:52:55 -03:00
Mariusz Felisiak
043dfadbce [4.2.x] Fixed #36098 -- Fixed validate_ipv6_address()/validate_ipv46_address() crash for non-string values.
Regression in ca2be7724e.

Backport of b3c5830769 from main.
2025-01-15 13:54:57 -03:00
Natalia
8769b44fda [4.2.x] Added CVE-2024-56374 to security archive.
Backport of f2a1dcaa53 from main.
2025-01-14 11:39:32 -03:00