Commit Graph

33613 Commits

Author SHA1 Message Date
Jacob Walls
dc32c07a3a [5.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:06 -05:00
Jacob Walls
7d796deb3b [5.2.x] Post-release version bump. 2026-02-03 08:22:12 -05:00
Jacob Walls
4a96a199bb [5.2.x] Bumped version for 5.2.11 release. 5.2.11 2026-02-03 08:20:00 -05:00
Jacob Walls
ab0ad8d395 [5.2.x] Refs CVE-2026-1312 -- Raised ValueError when FilteredRelation aliases contain periods.
This prevents failures at the database layer, given that aliases in the
ON clause are not quoted.

Systematically quoting aliases even in FilteredRelation is tracked in
https://code.djangoproject.com/ticket/36795.

Backport of 005d60d97c from main.
2026-02-03 08:19:02 -05:00
Jacob Walls
e863ee273c [5.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:18:30 -05:00
Jake Howard
3e68ccdc11 [5.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:17:34 -05:00
Natalia
9f2ada875b [5.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, and Jake Howard and Jacob Walls for
reviews.

Backport of a33540b3e2 from main.
2026-02-03 08:15:39 -05:00
Jacob Walls
17a1d64a58 [5.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:14:44 -05:00
Jake Howard
1ba90069c1 [5.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:13:57 -05:00
Jake Howard
184e38ab0a [5.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:13:08 -05:00
Jacob Walls
d8c551d214 [5.2.x] Added stub release notes and release date for 5.2.11 and 4.2.28.
Backport of b30e09a942 from main.
2026-01-27 15:33:51 -05:00
Tim Graham
3ea659dc1b [5.2.x] Clarified regression nature of data loss bug in docs/releases/5.2.10.txt.
Backport of 2be860d6cf from main.
2026-01-08 10:13:27 -05:00
Jacob Walls
e8317e08fc [5.2.x] Made release test script use a random available port.
Co-authored-by: Jake Howard <git@theorangeone.net>

Backport of c08ed084f9 from main.
2026-01-07 07:58:29 -05:00
Jacob Walls
755acfc739 [5.2.x] Added stub release notes for 5.2.11.
Backport of e937be3c1d from main.
2026-01-06 14:06:06 -05:00
Jacob Walls
6bc4e1ce37 [5.2.x] Post-release version bump. 2026-01-06 13:26:31 -05:00
Jacob Walls
8a0005cea0 [5.2.x] Bumped version for 5.2.10 release. 5.2.10 2026-01-06 13:20:52 -05:00
Jacob Walls
e20d1c2e55 [5.2.x] Added release date for 5.2.10.
Backport of f6fd35fc6d from main.
2026-01-06 13:06:05 -05:00
Simon Charette
2ca2afdffd [5.2.x] Refs #33647 -- Fixed silent data truncation in bulk_create on Postgres.
Regression in a16eedcf9c.

The UNNEST strategy is affected by the same problem bulk_update has wrt/
to silent data truncation due to its usage of db_type which always returns
a parametrized subtype.

Backport of d6ae2ed868 from main.
2025-12-31 10:47:20 -05:00
Skyiesac
8346657aaf [5.2.x] Fixed #36376 -- Fixed --no-color for command help in Python 3.14+.
https://github.com/python/cpython/pull/136809 made `color` default to
True in ArgumentParser.

Backport of d0d85cd165 from main.
2025-12-22 14:07:55 -05:00
Jacob Walls
9cc231e824 [5.2.x] Refs #27890 -- Avoided overwriting TMPDIR in runtests.py under forkserver mode.
This variable should only be set once. Under forkserver, this module
was getting executed multiple times, causing nested temporary dirs
that didn't clean up properly, raising FileNotFoundError.

This similar to #27890 although a slightly different cause.

Backport of cd6278c4c0 from main.
2025-12-11 12:27:00 -05:00
Jacob Walls
5ca0f62213 [5.2.x] Refs #36499 -- Adjusted test_strip_tags following Python behavior change for incomplete entities.
Backport of 7b80b21863 from main.
2025-12-11 11:37:31 -05:00
Natalia
322b717af5 [5.2.x] Added CVE-2025-13372 and CVE-2025-64460 to security archive.
Backport of d0d596042e from main.
2025-12-02 11:33:31 -03:00
Natalia
27c508acf4 [5.2.x] Added stub release notes for 5.2.10.
Backport of 8d4ec9949a from main.
2025-12-02 11:33:31 -03:00
Natalia
a3a8f7a866 [5.2.x] Post-release version bump. 2025-12-02 09:37:40 -03:00
Natalia
c14b756185 [5.2.x] Bumped version for 5.2.9 release. 5.2.9 2025-12-02 09:31:25 -03:00
Shai Berger
99e7d22f55 [5.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:27:50 -03:00
Jacob Walls
479415ce52 [5.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:27:34 -03:00
Jacob Walls
da1dfe64c8 [5.2.x] Fixed #36712 -- Evaluated type annotations lazily in template tag registration.
Ideally, this will be reverted when an upstream solution is available for
https://github.com/python/cpython/issues/141560.

Thanks Patrick Rauscher for the report and Augusto Pontes for the
first iteration and test.

Backport of 34186e731c from main.
2025-12-01 20:51:26 -05:00
Jacob Walls
e2ddec4313 [5.2.x] Refs #36743 -- Corrected docstring for DisallowedRedirect.
Backport of ce36c35e76 from main.
2025-12-01 16:34:26 -03:00
Jacob Walls
b83ee616c6 [5.2.x] Closed temporary files in OverwritingStorageTests.test_save_overwrite_behavior_temp_file().
Backport of a08f1693f3 from main.
2025-12-01 08:48:39 -05:00
Jacob Walls
645dc99ab4 [5.2.x] Refs #35535 -- Used intended decorator in test_simple_block_tag_parens().
Backport of e94b19f6ab from main.
2025-12-01 08:39:32 -05:00
Rida Zouga
85586052e8 [5.2.x] Added link to Python Pickle documentation in docs/topics/cache.txt.
Co-authored-by: Rida Zouga <ridazouga@gmail.com>
Backport of 3ea0195ca5 from main
2025-11-30 08:31:32 +01:00
Bruno Alla
de1dc3a874 [5.2.x] Fixed outdated redis-py link in cache docs.
Backport of 7b32485ee9 from main.
2025-11-27 17:14:31 +01:00
Tim Schilling
ee92d41f56 [5.2.x] Highlighted community package upgrade utilities in docs/howto/upgrade-version.txt.
Backport of bd7940982d from main.
2025-11-27 09:33:11 -03:00
Natalia
24ef35a585 [5.2.x] Added script to archive EOL stable branches.
This also fixed a small bash issue in `confirm_release.sh` script.

Backport of 532c1058a7 from main.
2025-11-26 20:07:10 -03:00
Natalia
2171933c5a [5.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:00:57 -03:00
varunkasyap
0ae15bb52e [5.2.x] Fixed #36743 -- Increased URL max length enforced in HttpResponseRedirectBase.
Refs CVE-2025-64458.

The previous limit of 2048 characters reused the URLValidator constant
and proved too restrictive for legitimate redirects to some third-party
services. This change introduces a separate `MAX_URL_REDIRECT_LENGTH`
constant (defaulting to 16384) and uses it in HttpResponseRedirectBase.

Thanks Jacob Walls for report and review.

Backport of a8cf8c292c from main.
2025-11-26 17:19:57 -03:00
Cha Hwa Young
31bc5c2d11 [5.2.x] Fixed #31506 -- Clarified that ExpressionWrapper does not perform database casts.
Added warning in DateField documentation about type differences when using
timedelta on PostgreSQL and MySQL. Mentioned Cast() and integer arithmetic
solutions.

Backport of 55af4749b9 from main.
2025-11-26 08:36:13 -05:00
Natalia
93fd01d641 [5.2.x] Added timeout-minutes directive to all GitHub Actions workflows.
GitHub Actions defaults to a 360-minute (6-hour) timeout. We've had jobs
hang due to issues in the parallel test runner, causing them to run for
the full 6 hours. This wastes resources and negatively impacts CI
availability, so explicit timeouts have been added to prevent
long-running hangs.

Backport of e48527f91d from main.
2025-11-26 08:03:38 -05:00
Natalia
bbbe64a262 [5.2.x] Added stub release notes and release date for 5.2.9, 5.1.15, and 4.2.27.
Backport of d62e811acf from main.
2025-11-25 15:17:14 -03:00
Simon Charette
1e7327770c [5.2.x] Fixed #36751 -- Fixed empty filtered aggregation crash over annotated queryset.
Regression in b8e5a8a9a2.

Refs #36404.

The replace_expressions method was innapropriately dealing with falsey
but not None source expressions causing them to also be potentially
evaluated when __bool__ was invoked (e.g. QuerySet.__bool__ evaluates
the queryset).

The changes introduced in b8e5a8a9a2, which were to deal with a similar
issue, surfaced the problem as aggregation over an annotated queryset
requires an inlining (or pushdown) of aggregate references which is
achieved through replace_expressions.

In cases where an empty Q object was provided as an aggregate filter,
such as when the admin facetting feature was used as reported, it would
wrongly be turned into None, instead of an empty WhereNode, causing a
crash at aggregate filter compilation.

Note that the crash signature differed depending on whether or not the
backend natively supports aggregate filtering
(supports_aggregate_filter_clause) as the fallback, which makes use
Case / When expressions, would result in a TypeError instead of a
NoneType AttributeError.

Thanks Rafael Urben for the report, Antoliny and Youngkwang Yang for
the triage.
Backport of 2a6e0bd72d from main
2025-11-24 12:15:48 +01:00
Jacob Walls
338912e84e [5.2.x] Configured dangerous-triggers zizmor rule.
Backport of 846613e521 from main.
2025-11-21 14:51:46 -05:00
Jacob Walls
6073e23556 [5.2.x] Addressed unpinned-uses zizmor finding.
Backport of 86b8058b40 from main.
2025-11-21 14:51:12 -05:00
Jacob Walls
8d6a6fa691 [5.2.x] Simplified actions after applying zizmor auto-fixes.
Backport of 08f4901b3f from main.
2025-11-21 14:51:04 -05:00
Jacob Walls
11deb358b6 [5.2.x] Applied auto-fixes from zizmor findings.
Backport of e8958c4690 from main.
2025-11-21 14:50:32 -05:00
Jacob Walls
fe3db5bcbb [5.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:43:27 -05:00
Natalia
2f0947146f [5.2.x] Added scripts for building and releasing Django artifacts.
Backport of a523d5c833 from main.
2025-11-21 15:38:20 -03:00
Natalia
53c9de624e [5.2.x] Skipped scripts/ folder from built release artifacts.
Backport of 971c76f735 from main.
2025-11-21 15:38:20 -03:00
Jacob Walls
43d3f5e2fa [5.2.x] Added missing ticket links in docs/releases/5.2.8.txt.
Backport of 8ce3e1f9d0 from main.
2025-11-20 17:32:20 -05:00
Chris Wesseling
ac9bdcabe1 [5.2.x] Fixed #36748 -- Filtered non-standard placeholders from UNNEST queries.
Backport of 5834643f43 from main.
2025-11-20 17:24:10 -05:00