Skip to content

Commit

Permalink
Merge pull request #208 from axios/v1.x
Browse files Browse the repository at this point in the history
Create a new pull request by comparing changes across two branches
  • Loading branch information
GulajavaMinistudio committed Jan 3, 2024
2 parents 496d63b + 8790b8e commit 62afb94
Show file tree
Hide file tree
Showing 22 changed files with 90 additions and 35 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/notify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,22 @@ on:
# - completed
#repository_dispatch:
# types: [ notify ]
release:
types: [ published ]
#release:
# types: [published]
# branches:
# - main
# - 'v**'
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
branches:
- main
- 'v**'

workflow_dispatch:
inputs:
tag:
required: true
required: false
jobs:
notify:
runs-on: ubuntu-latest
Expand Down
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## [1.6.4](https://github.com/axios/axios/compare/v1.6.3...v1.6.4) (2024-01-03)


### Bug Fixes

* **security:** fixed formToJSON prototype pollution vulnerability; ([#6167](https://github.com/axios/axios/issues/6167)) ([3c0c11c](https://github.com/axios/axios/commit/3c0c11cade045c4412c242b5727308cff9897a0e))
* **security:** fixed security vulnerability in follow-redirects ([#6163](https://github.com/axios/axios/issues/6163)) ([75af1cd](https://github.com/axios/axios/commit/75af1cdff5b3a6ca3766d3d3afbc3115bb0811b8))

### Contributors to this release

- <img src="https://avatars.githubusercontent.com/u/4814473?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Jay](https://github.com/jasonsaayman "+34/-6 ()")
- <img src="https://avatars.githubusercontent.com/u/12586868?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+34/-3 (#6172 #6167 )")
- <img src="https://avatars.githubusercontent.com/u/1402060?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Guy Nesher](https://github.com/gnesher "+10/-10 (#6163 )")

## [1.6.3](https://github.com/axios/axios/compare/v1.6.2...v1.6.3) (2023-12-26)


Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
<a href="https://stytch.com?utm_source=oss-sponsorship&utm_medium=paid_sponsorship&utm_content=logo&utm_campaign=axios-http">
<picture>
<source width="200px" media="(prefers-color-scheme: dark)" srcset="https://github.com/axios/axios/assets/4814473/538d715a-13c7-4668-ae7d-37a4548423f4">
<source width="200px" media="(prefers-color-scheme: light)" srcset="https://github.com/axios/axios/assets/4814473/538d715a-13c7-4668-ae7d-37a4548423f4">
<img width="200px" src="https://github.com/axios/axios/assets/4814473/538d715a-13c7-4668-ae7d-37a4548423f4" />
<source width="200px" media="(prefers-color-scheme: light)" srcset="https://github.com/axios/axios/assets/4814473/b6a9a7bc-9fb1-4b9b-909f-1b4bee1fd142">
<img width="200px" src="https://github.com/axios/axios/assets/4814473/b6a9a7bc-9fb1-4b9b-909f-1b4bee1fd142" />
</picture>
</a>
<p align="center">API-first authentication, authorization, and fraud prevention</p>
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "axios",
"main": "./dist/axios.js",
"version": "1.6.3",
"version": "1.6.4",
"homepage": "https://axios-http.com",
"authors": [
"Matt Zabriskie"
Expand Down
5 changes: 3 additions & 2 deletions dist/axios.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/axios.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/axios.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/axios.min.js.map

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions dist/browser/axios.cjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Axios v1.6.3 Copyright (c) 2023 Matt Zabriskie and contributors
// Axios v1.6.4 Copyright (c) 2024 Matt Zabriskie and contributors
'use strict';

function bind(fn, thisArg) {
Expand Down Expand Up @@ -1352,6 +1352,9 @@ function arrayToObject(arr) {
function formDataToJSON(formData) {
function buildPath(path, value, target, index) {
let name = path[index++];

if (name === '__proto__') return true;

const isNumericKey = Number.isFinite(+name);
const isLast = index >= path.length;
name = !name && utils$1.isArray(target) ? target.length : name;
Expand Down Expand Up @@ -2655,7 +2658,7 @@ function mergeConfig(config1, config2) {
return config;
}

const VERSION = "1.6.3";
const VERSION = "1.6.4";

const validators$1 = {};

Expand Down
2 changes: 1 addition & 1 deletion dist/browser/axios.cjs.map

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions dist/esm/axios.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/esm/axios.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/esm/axios.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/esm/axios.min.js.map

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions dist/node/axios.cjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Axios v1.6.3 Copyright (c) 2023 Matt Zabriskie and contributors
// Axios v1.6.4 Copyright (c) 2024 Matt Zabriskie and contributors
'use strict';

const FormData$1 = require('form-data');
Expand Down Expand Up @@ -1368,6 +1368,9 @@ function arrayToObject(arr) {
function formDataToJSON(formData) {
function buildPath(path, value, target, index) {
let name = path[index++];

if (name === '__proto__') return true;

const isNumericKey = Number.isFinite(+name);
const isLast = index >= path.length;
name = !name && utils$1.isArray(target) ? target.length : name;
Expand Down Expand Up @@ -2019,7 +2022,7 @@ function buildFullPath(baseURL, requestedURL) {
return requestedURL;
}

const VERSION = "1.6.3";
const VERSION = "1.6.4";

function parseProtocol(url) {
const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
Expand Down
2 changes: 1 addition & 1 deletion dist/node/axios.cjs.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/env/data.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const VERSION = "1.6.3";
export const VERSION = "1.6.4";
3 changes: 3 additions & 0 deletions lib/helpers/formDataToJSON.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ function arrayToObject(arr) {
function formDataToJSON(formData) {
function buildPath(path, value, target, index) {
let name = path[index++];

if (name === '__proto__') return true;

const isNumericKey = Number.isFinite(+name);
const isLast = index >= path.length;
name = !name && utils.isArray(target) ? target.length : name;
Expand Down
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "axios",
"version": "1.6.3",
"version": "1.6.4",
"description": "Promise based HTTP client for the browser and node.js",
"main": "index.js",
"exports": {
Expand Down Expand Up @@ -146,7 +146,7 @@
"unpkg": "dist/axios.min.js",
"typings": "./index.d.ts",
"dependencies": {
"follow-redirects": "^1.15.0",
"follow-redirects": "^1.15.4",
"form-data": "^4.0.0",
"proxy-from-env": "^1.1.0"
},
Expand Down
21 changes: 21 additions & 0 deletions test/specs/helpers/formDataToJSON.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,25 @@ describe('formDataToJSON', function () {
foo: ['1', '2']
});
});

it('should resist prototype pollution CVE', () => {
const formData = new FormData();

formData.append('foo[0]', '1');
formData.append('foo[1]', '2');
formData.append('__proto__.x', 'hack');
formData.append('constructor.prototype.y', 'value');

expect(formDataToJSON(formData)).toEqual({
foo: ['1', '2'],
constructor: {
prototype: {
y: 'value'
}
}
});

expect({}.x).toEqual(undefined);
expect({}.y).toEqual(undefined);
});
});
2 changes: 1 addition & 1 deletion test/unit/adapters/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ describe('supports http with nodejs', function () {
}
}
}).catch(function (error) {
assert.equal(error.message, 'Provided path is not allowed');
assert.equal(error.message, 'Redirected request failed: Provided path is not allowed');
done();
}).catch(done);
});
Expand Down

0 comments on commit 62afb94

Please sign in to comment.