diff --git a/README.md b/README.md
index 9bf03e58..3292e129 100644
--- a/README.md
+++ b/README.md
@@ -372,6 +372,19 @@ The available instance methods are listed below. The specified config will be me
## Request Config
+### ⚠️ Security notice: decompression-bomb protection is opt-in
+
+By default `maxContentLength` and `maxBodyLength` are `-1` (unlimited). A malicious or compromised server can return a tiny gzip/deflate/brotli body that expands to gigabytes and exhaust the Node.js process.
+
+If you call servers you do not fully trust, **set a cap**:
+
+```js
+axios.defaults.maxContentLength = 10 * 1024 * 1024; // 10 MB
+axios.defaults.maxBodyLength = 10 * 1024 * 1024;
+```
+
+See the [security guide](https://axios.rest/pages/misc/security.html) for details.
+
These are the available config options for making requests. Only the `url` is required. Requests will default to `GET` if `method` is not specified.
```js
diff --git a/docs/es/pages/advanced/request-config.md b/docs/es/pages/advanced/request-config.md
index 2d1befa7..cb207247 100644
--- a/docs/es/pages/advanced/request-config.md
+++ b/docs/es/pages/advanced/request-config.md
@@ -137,6 +137,9 @@ La función `onDownloadProgress` te permite escuchar el progreso de una descarga
La propiedad `maxContentLength` define el número máximo de bytes que el servidor aceptará en la respuesta.
+> ⚠️ **Seguridad:** el valor por defecto es `-1` (sin límite). Las respuestas sin límite combinadas con la descompresión gzip/deflate/brotli permiten ataques de denegación de servicio por bomba de descompresión.
+> Establece un límite explícito al consumir servidores en los que no confíes plenamente.
+
### `maxBodyLength`
La propiedad `maxBodyLength` define el número máximo de bytes que el servidor aceptará en la solicitud.
diff --git a/docs/es/pages/misc/security.md b/docs/es/pages/misc/security.md
index c86ad6d3..ec42f6d4 100644
--- a/docs/es/pages/misc/security.md
+++ b/docs/es/pages/misc/security.md
@@ -1,5 +1,24 @@
# Política de seguridad
+## ⚠️ Bomba de descompresión / almacenamiento de respuesta sin límites
+
+Por defecto, `maxContentLength` y `maxBodyLength` están configurados en `-1` (sin límite). Un servidor malicioso o comprometido puede devolver un cuerpo pequeño comprimido con gzip/deflate/brotli que se expande a gigabytes, agotando la memoria del proceso Node.js.
+
+**Si realizas solicitudes a servidores en los que no confías plenamente, DEBES establecer un `maxContentLength` (y `maxBodyLength`) adecuado para tu carga de trabajo.** El límite se aplica chunk a chunk durante la descompresión en flujo, así que basta con configurarlo para neutralizar ataques de bomba de descompresión.
+
+```js
+axios.get('https://example.com/data', {
+ maxContentLength: 10 * 1024 * 1024, // 10 MB
+ maxBodyLength: 10 * 1024 * 1024,
+});
+
+// O globalmente:
+axios.defaults.maxContentLength = 10 * 1024 * 1024;
+axios.defaults.maxBodyLength = 10 * 1024 * 1024;
+```
+
+El valor por defecto no se ha endurecido porque hacerlo romperá silenciosamente cualquier descarga legítima mayor al límite elegido. La responsabilidad de escoger un tope seguro para fuentes no confiables recae en la aplicación.
+
## Reportar una vulnerabilidad
Si crees haber encontrado una vulnerabilidad de seguridad en el proyecto, por favor repórtanosla como se describe a continuación. Tomamos todas las vulnerabilidades de seguridad con seriedad. Si has encontrado una vulnerabilidad en una librería de terceros, por favor repórtala a los responsables de esa librería.
diff --git a/docs/fr/pages/advanced/request-config.md b/docs/fr/pages/advanced/request-config.md
index e3315897..4fa9b8df 100644
--- a/docs/fr/pages/advanced/request-config.md
+++ b/docs/fr/pages/advanced/request-config.md
@@ -137,6 +137,9 @@ La fonction `onDownloadProgress` vous permet d'écouter la progression d'un tél
La propriété `maxContentLength` définit le nombre maximum d'octets que le serveur acceptera dans la réponse.
+> ⚠️ **Sécurité :** la valeur par défaut est `-1` (illimitée). Des réponses non bornées combinées à la décompression gzip/deflate/brotli rendent possible un déni de service par bombe de décompression.
+> Définissez une limite explicite lorsque vous consommez des serveurs auxquels vous ne faites pas pleinement confiance.
+
### `maxBodyLength`
La propriété `maxBodyLength` définit le nombre maximum d'octets que le serveur acceptera dans la requête.
diff --git a/docs/fr/pages/misc/security.md b/docs/fr/pages/misc/security.md
index 5879a548..4d2c6933 100644
--- a/docs/fr/pages/misc/security.md
+++ b/docs/fr/pages/misc/security.md
@@ -1,5 +1,24 @@
# Politique de sécurité
+## ⚠️ Bombe de décompression / mise en tampon de réponse sans limite
+
+Par défaut, `maxContentLength` et `maxBodyLength` valent `-1` (illimité). Un serveur malveillant ou compromis peut renvoyer un petit corps compressé en gzip/deflate/brotli qui s'étend à plusieurs gigaoctets, épuisant la mémoire du processus Node.js.
+
+**Si vous effectuez des requêtes vers des serveurs que vous ne contrôlez pas totalement, vous DEVEZ définir `maxContentLength` en fonction de votre charge.** La limite est appliquée chunk par chunk pendant la décompression en flux, il suffit donc de la définir pour neutraliser les attaques de bombe de décompression.
+
+```js
+axios.get('https://example.com/data', {
+ maxContentLength: 10 * 1024 * 1024, // 10 Mo
+ maxBodyLength: 10 * 1024 * 1024,
+});
+
+// Ou globalement :
+axios.defaults.maxContentLength = 10 * 1024 * 1024;
+axios.defaults.maxBodyLength = 10 * 1024 * 1024;
+```
+
+La valeur par défaut n'a pas été durcie car cela casserait silencieusement tout téléchargement légitime dépassant le plafond choisi. Le choix d'un plafond sûr pour des sources non fiables incombe à l'application.
+
## Signaler une vulnérabilité
Si vous pensez avoir trouvé une vulnérabilité de sécurité dans le projet, veuillez nous la signaler comme décrit ci-dessous. Nous prenons toutes les vulnérabilités de sécurité au sérieux. Si vous avez trouvé une vulnérabilité dans une bibliothèque tierce, veuillez la signaler aux mainteneurs de cette bibliothèque.
diff --git a/docs/pages/advanced/request-config.md b/docs/pages/advanced/request-config.md
index 8bda703c..ab0503d8 100644
--- a/docs/pages/advanced/request-config.md
+++ b/docs/pages/advanced/request-config.md
@@ -137,6 +137,9 @@ The `onDownloadProgress` function allows you to listen to the progress of a down
The `maxContentLength` property defines the maximum number of bytes that the server will accept in the response.
+> ⚠️ **Security:** defaults to `-1` (unlimited). Unbounded responses combined with gzip/deflate/brotli decompression allow decompression-bomb DoS.
+> Set an explicit limit when requesting servers you do not fully trust.
+
### `maxBodyLength`
The `maxBodyLength` property defines the maximum number of bytes that the server will accept in the request.
diff --git a/docs/pages/misc/security.md b/docs/pages/misc/security.md
index 77ec7ad0..b561740c 100644
--- a/docs/pages/misc/security.md
+++ b/docs/pages/misc/security.md
@@ -1,5 +1,24 @@
# Security policy
+## ⚠️ Decompression bomb / unbounded response buffering
+
+By default, `maxContentLength` and `maxBodyLength` are set to `-1` (unlimited). A malicious or compromised server can return a small gzip/deflate/brotli-compressed body that expands to gigabytes, exhausting memory in the Node.js process.
+
+**If you make requests to servers you do not fully trust, you MUST set a `maxContentLength` (and `maxBodyLength`) suitable for your workload.** The limit is enforced chunk-by-chunk during streaming decompression, so setting it is sufficient to neutralize decompression-bomb attacks.
+
+```js
+axios.get('https://example.com/data', {
+ maxContentLength: 10 * 1024 * 1024, // 10 MB
+ maxBodyLength: 10 * 1024 * 1024,
+});
+
+// Or globally:
+axios.defaults.maxContentLength = 10 * 1024 * 1024;
+axios.defaults.maxBodyLength = 10 * 1024 * 1024;
+```
+
+The default was not tightened because doing so would silently break every legitimate download larger than the chosen cap. The responsibility to pick a safe ceiling for untrusted sources rests with the application.
+
## Reporting a Vulnerability
If you believe you have found a security vulnerability in the project, please report it to us as described below. We take all security vulnerabilities seriously. If you have found a vulnerability in a third-party library, please report it to the maintainers of that library.
@@ -7,6 +26,7 @@ If you believe you have found a security vulnerability in the project, please re
## Reporting Process
Please do not report security vulnerabilities through public GitHub issues. Please use the official security channel on GitHub by logging a [security advisory](https://github.com/axios/axios/security).
+
## Disclosure Policy
When we receive a security vulnerability report, we will assign it a primary handler. This person is responsible for the vulnerability report. The handler will confirm the problem and determine the affected versions. The handler will then evaluate the problem and determine the severity of the issue. The handler will develop a fix for the problem and prepare a release. The handler will notify the reporter when the fix is ready to be announced.
diff --git a/docs/zh/pages/advanced/request-config.md b/docs/zh/pages/advanced/request-config.md
index f5aa527e..d21fadc6 100644
--- a/docs/zh/pages/advanced/request-config.md
+++ b/docs/zh/pages/advanced/request-config.md
@@ -137,6 +137,9 @@
`maxContentLength` 属性定义服务器在响应中允许接收的最大字节数。
+> ⚠️ **安全提示:** 默认值为 `-1`(不限制)。响应不加限制再加上 gzip/deflate/brotli 解压,会带来解压炸弹导致的拒绝服务风险。
+> 在访问不完全可信的服务器时,请显式设置该限制。
+
### `maxBodyLength`
`maxBodyLength` 属性定义服务器在请求中允许接收的最大字节数。
diff --git a/docs/zh/pages/misc/security.md b/docs/zh/pages/misc/security.md
index ed662ea3..bcdde584 100644
--- a/docs/zh/pages/misc/security.md
+++ b/docs/zh/pages/misc/security.md
@@ -1,5 +1,24 @@
# 安全政策
+## ⚠️ 解压炸弹 / 响应无限缓冲
+
+默认情况下,`maxContentLength` 与 `maxBodyLength` 均为 `-1`(不限制)。恶意或被攻陷的服务器可以返回一个很小的 gzip/deflate/brotli 压缩响应,解压后体积可达数 GB,耗尽 Node.js 进程的内存。
+
+**如果你向不完全可信的服务器发起请求,必须根据你的业务场景设置合适的 `maxContentLength`(以及 `maxBodyLength`)。** 在流式解压过程中会按分块强制执行该限制,因此只需设置该值即可抵御解压炸弹攻击。
+
+```js
+axios.get('https://example.com/data', {
+ maxContentLength: 10 * 1024 * 1024, // 10 MB
+ maxBodyLength: 10 * 1024 * 1024,
+});
+
+// 或全局设置:
+axios.defaults.maxContentLength = 10 * 1024 * 1024;
+axios.defaults.maxBodyLength = 10 * 1024 * 1024;
+```
+
+默认值未被调低是因为调低会静默地影响所有合法的大文件下载。为不可信来源选择合理的上限,应由应用自行负责。
+
## 报告漏洞
如果你认为在本项目中发现了安全漏洞,请按照以下说明向我们报告。我们对所有安全漏洞报告都认真对待。如果你发现的是第三方库中的漏洞,请向该库的维护者报告。