14605 Commits

Author SHA1 Message Date
SnippyCodes
6c2436fa86 Fixed #36272 -- Removed obsolete libgeoip from GeoDjango installation docs. 2026-02-06 10:31:16 -05:00
jafarkhan83
13299a6203 Fixed #36898 -- Documented SessionBase.is_empty(). 2026-02-03 11:02:50 -05:00
Jacob Walls
af361d3be4 Added CVE-2025-13473, CVE-2025-14550, CVE-2026-1207, CVE-2026-1285, CVE-2026-1287, and CVE-2026-1312 to security archive. 2026-02-03 09:11:06 -05:00
Jacob Walls
e7e43f1f91 Added stub release notes for 6.0.3. 2026-02-03 09:05:18 -05:00
Jacob Walls
69065ca869 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.
2026-02-03 07:55:33 -05:00
Jake Howard
e891a84c7e 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.
2026-02-03 07:55:04 -05:00
Natalia
a33540b3e2 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.
2026-02-03 07:54:16 -05:00
Jacob Walls
81aa529296 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.
2026-02-03 07:53:50 -05:00
Jake Howard
eb22e1d6d6 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.
2026-02-03 07:53:12 -05:00
Jake Howard
3eb814e02a 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>
2026-02-03 07:52:25 -05:00
Jacob Walls
b665a67d61 Fixed #36788 -- Fixed horizontal form field alignment under <fieldset> in the admin.
Thanks Antoliny for the review.

Regression in 4187da258f.
2026-02-02 08:15:13 -05:00
Jacob Walls
986f7f2098 Added missing quotes around nonce in docs/ref/csp.txt. 2026-02-02 07:29:41 -05:00
Jacob Walls
4a52533329 Refs #34118 -- Removed asgiref coroutine detection shims.
As Python 3.12 is now the floor, we can drop the shims and
use the `inspect` module.
2026-01-31 08:59:54 -05:00
Tim Schilling
93dfb16e96 Added documentation on reviewing patches.
Original inspiration drawn from Sarah Boyce's talk:
"Django needs you! (to do code review)"
2026-01-30 20:48:59 -05:00
Jacob Walls
cbc4c9f11f Fixed typos in docs/ref/models/querysets.txt. 2026-01-30 15:59:14 -05:00
Natalia
117ff1d37d Made explicit that aspell is a requirement to run spell checks on docs. 2026-01-29 11:20:11 -03:00
Natalia
ba96379011 Fixed docs spelling errors accumulated over time.
The `docs` GitHub action does not install `aspell` so the seplling
checks are always passing in CI. After installing it, the following
errors are reported:

WARNING: internals/security.txt:50: : Spell check: runnable: Include a runnable proof of concept.
WARNING: ref/contrib/postgres/search.txt:292: : Spell check: lexeme: an untrusted source. The content of each lexeme is escaped so that any.
WARNING: ref/contrib/postgres/search.txt:295: : Spell check: lexemes: You can combine lexemes with other lexemes using the .
WARNING: ref/contrib/postgres/search.txt:295: : Spell check: lexemes: You can combine lexemes with other lexemes using the .
WARNING: ref/contrib/postgres/search.txt:314: : Spell check: Lexeme: Lexeme objects also support term weighting and prefixes:.
WARNING: ref/models/database-functions.txt:1897: : Spell check: ai: 23ai/26ai (23.9) or later..
WARNING: ref/models/database-functions.txt:1897: : Spell check: ai: 23ai/26ai (23.9) or later..
WARNING: ref/models/expressions.txt:439: : Spell check: positionally:  can be supplied positionally or only by keyword. For.
WARNING: ref/models/fields.txt:1339: : Spell check: ai: PostgreSQL < 18 only supports persisted columns. Oracle < 23ai/26ai (23.7).
WARNING: ref/models/fields.txt:1339: : Spell check: ai: PostgreSQL < 18 only supports persisted columns. Oracle < 23ai/26ai (23.7).
WARNING: ref/models/fields.txt:1344: : Spell check: ai: s was added on Oracle 23ai/26ai.
WARNING: ref/models/fields.txt:1344: : Spell check: ai: s was added on Oracle 23ai/26ai.
WARNING: releases/4.2.21.txt:24: : Spell check: unclosed: exception if it encounters an unusually large number of unclosed opening tags..
WARNING: releases/5.1.9.txt:24: : Spell check: unclosed: exception if it encounters an unusually large number of unclosed opening tags..
WARNING: releases/5.2.1.txt:24: : Spell check: unclosed: exception if it encounters an unusually large number of unclosed opening tags..
WARNING: releases/6.1.txt:244: : Spell check: mistyped: suggestions for mistyped subcommand names and argument choices..
WARNING: releases/6.1.txt:281: : Spell check: ai: Oracle 23ai/26ai (23.7+)..
WARNING: releases/6.1.txt:281: : Spell check: ai: Oracle 23ai/26ai (23.7+)..
WARNING: releases/6.1.txt:343: : Spell check: durations: durations expressed in weeks (.
WARNING: Found 19 misspelled words
build finished with problems, 20 warnings (with warnings treated as errors).

This branch adds some of the words to the allowlist, but for others I
chose to rephrase the text in a more approachable manner.
2026-01-29 11:20:11 -03:00
Nilesh Kumar Pahari
fe189dc43a Fixed #36847 -- Ensured auto_now_add fields are set on pre_save().
Regression in 94680437a4. Refs #27222.

During INSERT operations, `field.pre_save()` is called to prepare values
for db insertion. The `add` param must be `True` for `auto_now_add`
fields to be populated. The regression commit passed `False`, causing
`auto_now_add` fields to remain `None` when used by other fields, such
as `upload_to` callables.

Thanks Ran Benita for the report.
2026-01-29 10:11:33 -03:00
Jacob Walls
e61a54d306 Doc'd the minimum version of bash for releasing Django. 2026-01-28 16:51:29 -05:00
Jacob Walls
b30e09a942 Added stub release notes and release date for 6.0.2, 5.2.11, and 4.2.28. 2026-01-27 15:31:24 -05:00
Nilesh Kumar Pahari
e92d1e3b78 Fixed #36850 -- Prevented admin filter sidebar from wrapping below the changelist.
Removed flex-wrap from .changelist-form-container and added min-width to the
main content container to ensure proper layout behavior.
Regression in 6ea3319079.
2026-01-26 10:25:47 -05:00
Skyiesac
c3c9f1908e Fixed #36812 -- Dropped support for MariaDB < 10.11. 2026-01-25 09:19:43 +01:00
seanhelvey
b1ffa9a9d7 Fixed #13883 -- Rendered named choice groups with <optgroup> in FilteredSelectMultiple.
This patch adds support for <optgroup>s in FilteredSelectMultiple widgets.
When a popup returns a new object, if the source field contains optgroup
choices, the optgroup is now also included in the response data.

Additionally, this adds error handling for invalid source_model parameters
to prevent crashes and display user-friendly error messages instead.

Co-authored-by: Michael McLarnon <mmclar@gmail.com>
2026-01-22 21:12:23 -05:00
Clifford Gama
d6cca8b904 Refs #25508 -- Updated outdated QuerySet.__repr__() results. 2026-01-19 09:58:43 -05:00
Clifford Gama
2541641347 Fixed unbalanced parentheses in docs. 2026-01-19 08:39:25 -05:00
Mariusz Felisiak
6cff020787 Applied Black's 2026 stable style.
https://github.com/psf/black/releases/tag/26.1.0
2026-01-18 21:26:56 +01:00
Amar Ahmed Deina
07a1640745 Fixed #36856 -- Mentioned needsnewfeatureprocess resolution in contributor docs.
Co-authored-by: James Bligh <blighj@users.noreply.github.com>
2026-01-15 07:27:02 -05:00
Jacob Walls
a876ada18b Bumped linter versions in requirements files and tox.ini.
Follow-up to 64ac4385c7.
2026-01-14 15:07:10 -05:00
kundan223
924156072e Fixed #36855, Refs #27222 -- Mentioned multiple invocations of Field.pre_save() in 6.0 release notes.
Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>
2026-01-14 14:45:03 -05:00
Jacob Walls
73c5e94521 Refs #36769 -- Raised SuspiciousOperation for unexpected nested tags in XML Deserializer.
Thanks Shai Berger and Natalia Bidart for reviews.
2026-01-12 16:38:32 -05:00
Haki Benita
d61838761f Fixed #36827 -- Added support for exclusion constraints using Hash indexes on PostgreSQL. 2026-01-10 08:12:05 +01:00
Clifford Gama
1d15c732bb Refs #35381 -- Added missing deprecation note for using None as RHS of JSONExact. 2026-01-09 15:49:34 -05:00
Jacob Walls
f3b982f21f Fixed a typo in docs/ref/forms/models.txt. 2026-01-08 19:10:40 -05:00
Amar Ahmed Deina
091ffc4e5e Fixed #36844 -- Clarified need for reusable apps to set default_auto_field in packaging tutorial and AppConfig docs. 2026-01-08 10:20:38 -05:00
Tim Graham
2be860d6cf Clarified regression nature of data loss bug in docs/releases/6.0.1.txt and 5.2.10.txt. 2026-01-08 10:11:28 -05:00
Natalia
8703fbdf10 Added guidance on AI-assisted code submission to contributing docs. 2026-01-08 12:01:53 -03:00
Natalia
1717332ca2 Relocated content from docs/topics/external-packages.txt where appropriate.
Following up a forum post and a conversation with the Steering Council,
it was decided to remove the docs/topics/external-packages.txt to avoid
confusion with the Ecosystem page. Relevant content was moved to their
related sections, except for `django-contrib-comments` which is not
actively maintained.

Thank you Tim Schilling for the review.
2026-01-08 10:50:56 -03:00
Natalia
fd5def6367 Dropped unnecessary usage of "seealso" in BoundField docs. 2026-01-08 10:50:56 -03:00
Jacob Walls
b59c215eab Added stub release notes for 6.0.2. 2026-01-06 14:03:56 -05:00
Jacob Walls
e937be3c1d Added stub release notes for 5.2.11. 2026-01-06 14:02:13 -05:00
Jacob Walls
496af73bf6 Added release date for 6.0.1. 2026-01-06 13:02:16 -05:00
Jacob Walls
f6fd35fc6d Added release date for 5.2.10. 2026-01-06 13:02:01 -05:00
Jacob Walls
030c63d329 Fixed #36843, #36793 -- Reverted "Fixed #27489 -- Renamed permissions upon model renaming in migrations."
This reverts commits f02b49d2f3 and 6e89271a85.
2026-01-05 15:45:27 -05:00
Simon Charette
d6ae2ed868 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.
2025-12-31 10:41:55 -05:00
Johannes Maron
79ab0993d0 Fixed #36829 -- Reverted value of ClearableFileInput.use_fieldset to True.
There was unresolved discussion regarding whether to set
ClearableFileInput.use_fieldset to True or False when use_fieldset was
introduced in Django 4.1, since the clear checkbox appears only
sometimes. Although using <fieldset> is likely desirable, since the
primary motivation in #35892 was just to improve markup in the admin,
and a deprecation path was not provided for general form usage, future
work is deferred to #36828.

Regression in 4187da258f.

Thanks Tim Graham, Antoliny, and David Smith for triage.
2025-12-31 10:14:00 -05:00
Duane Hilton
626c15dba0 Fixed #30515 -- Documented resolve_url() in docs/topics/http/shortcuts.txt. 2025-12-26 12:29:06 -03:00
kundan223
7bf3ac3ee2 Fixed #36796 -- Handled lazy routes correctly in RoutePattern.match().
Coerce lazy route values to `str` at match time to support prefix and
endpoint matching when using `gettext_lazy()` route paths.

Regression in f920937c8a.

Thanks to Andrea Angelini for the report, and to Jake Howard and Jacob
Walls for reviews.

Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
2025-12-26 09:24:58 -03:00
Sean Reed
165c359996 Refs #36810 -- Avoided infinite recursion in LazyNonce.__repr__().
Moved nonce generation in ``django.utils.csp.LazyNonce`` to a function
to avoid infinite recursion in ``SimpleLazyObject.__repr__`` for
unevaluated instances.

Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
2025-12-24 14:46:41 -03:00
Yilei
68859a9b45 Added missing sentence period in docs/intro/tutorial02.txt. 2025-12-23 16:01:16 -03:00
Jacob Walls
1eac2659a1 Fixed #36807 -- Fixed form field alignment under <fieldset> in the admin.
It isn't safe to set display: flex on <fieldset>, because on Safari this
interferes with display: block on child divs.

Thanks Paulo Coutinho for the report and Antoliny for the review.

Regression in 4187da258f.
2025-12-22 21:04:01 -05:00