Commit graph

33589 commits

Author SHA1 Message Date
Natalia
c14b756185 [5.2.x] Bumped version for 5.2.9 release. 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
varunkasyap
001c2f546b [5.2.x] Fixed #36733 -- Escaped attributes in Stylesheet.__str__().
Thanks Mustafa Barakat for the report, Baptiste Mispelon for
the triage, and Jake Howard for the review.

Backport of e05f2a7569 from main.
2025-11-18 17:17:28 -05:00
Kasyap Pentamaraju
edec3e59a3 [5.2.x] Fixed #36686 -- Clarified Meta.ordering is ignored in GROUP BY queries.
Backport of 7e765a6859 from main.
2025-11-13 11:19:25 -05:00
Markus Holtermann
fea599d2a2 [5.2.x] Fixed unsafe variable interpolation in GitHub Action workflow.
Thank you Davide Netti for the report and initial patch.

Co-authored-by: Davide Netti <davide.netti4@gmail.com>

Backport of 01c70ba148 from main.
2025-11-10 15:53:29 -03:00
Natalia
aca28b50d6 [5.2.x] Added CVE-2025-64458 and CVE-2025-64459 to security archive.
Backport of c5a107e824 from main.
2025-11-05 11:18:46 -03:00
Natalia
842200752c [5.2.x] Added stub release notes for 5.2.9.
Backport of 6e18c078d5 from main.
2025-11-05 11:18:37 -03:00
Natalia
f4ff2f8d14 [5.2.x] Post-release version bump. 2025-11-05 09:40:30 -03:00
Natalia
47fe39af56 [5.2.x] Bumped version for 5.2.8 release. 2025-11-05 09:35:08 -03:00
Jacob Walls
ac9fcf6eb2 [5.2.x] Refs CVE-2025-64459 -- Avoided propagating invalid arguments to Q on dictionary expansion.
Backport of 3c3f463577 from main.
2025-11-05 09:33:29 -03:00
Jacob Walls
6703f364d7 [5.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:33:15 -03:00
Jacob Walls
4f5d904b63 [5.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.

Follow-up to CVE-2025-27556 and 39e2297210.

Backport of c880530ddd from main.
2025-11-05 09:32:59 -03:00
Hal Blackburn
cbdf128cb3 [5.2.x] Fixed #36704 -- Fixed system check error for proxy model with a composite pk.
Proxy models subclassing a model with a CompositePrimaryKey were
incorrectly reporting check errors because the check that requires only
local fields to be used in a composite pk was evaluated against the proxy
subclass, which has no fields.

To fix this, composite pk field checks are not evaluated against
proxy subclasses, as none of the checks are applicable to proxy
subclasses. This also has the benefit of not double-reporting real check
errors from an invalid superclass pk.

Thanks Clifford Gama for the review.

Backport of 74564946c3 from main.
2025-11-04 12:00:58 -05:00
Patrick Rauscher
6775888470 [5.2.x] Fixed #36696 -- Fixed NameError when inspecting functions with deferred annotations.
In Python 3.14, annotations are deferred by default, so we should not
assume that the names in them have been imported unconditionally.
2025-10-31 08:47:32 -04:00
Jacob Walls
d5dfffaae5 [5.2.x] Added stub release notes and release date for 5.2.8, 5.1.14, and 4.2.26.
Backport of ab108bf94d from main.
2025-10-29 15:00:08 -03:00
Kasyap Pentamaraju
368f955c37 [5.2.x] Fixed #36681 -- Removed English pluralization bias from example in docs/topics/i18n/translation.txt.
Backport of 0ea01101c3 from main.
2025-10-27 14:43:40 -04:00
Annabelle Wiegart
71267c97db [5.2.x] Fixed #35095 -- Clarified Swiss number formatting in docs/topics/i18n/formatting.txt.
Co-authored-by: Ahmed Nassar <a.moh.nassar00@gmail.com>

Backport of 7423918125 from main.
2025-10-23 10:14:20 -04:00
Mariusz Felisiak
9b37bd5fe7 [5.2.x] Made RemoteTestResultTest.test_pickle_errors_detection() compatible with tblib 3.2+.
tblib 3.2+ makes exception subclasses with __init__() and the default
__reduce__() picklable. This broke the test for
RemoteTestResult._confirm_picklable(), which expects a specific
exception to fail unpickling.

https://github.com/ionelmc/python-tblib/blob/master/CHANGELOG.rst#320-2025-10-21

This fix defines ExceptionThatFailsUnpickling.__reduce__() in a way
that pickle.dumps(obj) succeeds, but pickle.loads(pickle.dumps(obj))
raises TypeError.

Refs #27301. This preserves the intent of the regression test from
52188a5ca6 without skipping it.

Backport of 548209e620 from main.
2025-10-21 23:14:05 -03:00
Mariusz Felisiak
796456d84e [5.2.x] Fixed RelatedGeoModelTest.test_related_union_aggregate() test on Oracle and GEOS 3.12+.
Backport of 344ae16e1e from main
2025-10-20 16:06:20 +02:00
Mariusz Felisiak
a8c9b5b263 [5.2.x] Refs #35844 -- Doc'd Python 3.14 compatibility.
Backport of 56977b466c from main.
2025-10-17 20:05:19 +02:00
aj2s
83f6fe810d [5.2.x] Fixed #36669 -- Doc'd that negative indexes are not supported in F() slices.
Backport of f715bc8990 from main.
2025-10-17 10:22:40 -04:00
Jacob Walls
dc61f20578 [5.2.x] Refs #36648 -- Removed hardcoded pk in CompositePKAggregateTests.
Backport of bee64561a6 from main.
2025-10-15 23:45:45 -04:00
Jacob Walls
8baee531d4 [5.2.x] Fixed #36648, Refs #33772 -- Accounted for composite pks in first()/last() when aggregating.
Backport of 02eed4f378 from main.
2025-10-14 15:50:26 -04:00
arsalan64
94cbd67d9e [5.2.x] Fixed #36625 -- Mentioned exit() in tutorial's instruction to restart the shell.
Backport of 92d0c21e69 from main.
2025-10-13 16:23:12 -04:00
Simon Charette
88ef9ea6c5 [5.2.x] Fixed #36646 -- Added compatibility for oracledb 3.4.0.
The Database.Binary, Date, and Timestamp attributes were changed from
aliases to bytes, datetime.date, and datetime.datetime to factory
functions in oracle/python-oracledb@869a887819
which made their usage inadequate for isinstance checks.

Thanks John Wagenleitner for the report and Natalia for the triage.

Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>

Backport of 315dbe675d from main
2025-10-11 19:03:27 +02:00
Mariusz Felisiak
713e9d8f53 [5.2.x] Corrected admin check IDs in docs.
Backport of 1167cd1d63 from main
2025-10-09 20:03:00 +02:00