---
title: "Django 4.2.14 版本发行说明"
version: 5.1
locale: zh-hans
source: https://docs.djangoproject.com/zh-hans/5.1/releases/4.2.14/
canonical: https://djangodocs.dev/zh-hans/5.1/releases/4.2.14/
---
# Django 4.2.14 版本发行说明

*2024 年 7 月 9 日*

Django 4.2.14 修复了 4.2.13 中的两个严重程度为“中等”的安全问题和两个严重程度为“低”的安全问题。

## CVE-2024-38875：`django.utils.html.urlize()` 中潜在的拒绝服务漏洞

[`urlize`](/zh-hans/5.1/ref/templates/builtins/#std-templatefilter-urlize) 和 [`urlizetrunc`](/zh-hans/5.1/ref/templates/builtins/#std-templatefilter-urlizetrunc) 可能会因某些包含大量括号的输入而遭受潜在的拒绝服务攻击。

## CVE-2024-39329：通过不可用密码用户的计时差异进行用户名枚举

[`authenticate()`](/zh-hans/5.1/ref/contrib/auth/#django.contrib.auth.backends.ModelBackend.authenticate) 方法允许远程攻击者通过对不可用密码用户的登录请求进行计时攻击来枚举用户。

## CVE-2024-39330：通过 `Storage.save()` 可能导致的目录遍历漏洞

继承自 [`Storage`](/zh-hans/5.1/ref/files/storage/#django.core.files.storage.Storage) 基类的派生类，如果重写了 [`generate_filename()`](/zh-hans/5.1/ref/files/storage/#django.core.files.storage.Storage.generate_filename) 但没有复制父类中存在的文件路径验证逻辑，可能会在调用 [`save()`](/zh-hans/5.1/ref/files/storage/#django.core.files.storage.Storage.save) 时因某些输入导致潜在的目录遍历问题。

内置的 `Storage` 子类不受此漏洞影响。

## CVE-2024-39614：`get_supported_language_variant()` 中潜在的拒绝服务漏洞

[`get_supported_language_variant()`](/zh-hans/5.1/ref/utils/#django.utils.translation.get_supported_language_variant) 在处理包含特定字符的非常长字符串时，可能会遭受潜在的拒绝服务攻击。

为了缓解此漏洞，现在提供给 [`get_supported_language_variant()`](/zh-hans/5.1/ref/utils/#django.utils.translation.get_supported_language_variant) 的语言代码最多解析 500 个字符。

当语言代码超过 500 个字符时，如果 `strict` 为 `True`，或者没有通用变体且 `strict` 为 `False`，现在会抛出 [`ValueError`](https://docs.python.org/3/library/exceptions.html#ValueError)。
