step-node-agent 3.24.4 → 3.24.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,16 +1,21 @@
1
+ 0.6.0 / 2023-11-06
2
+ ==================
3
+
4
+ * Add `partitioned` option
5
+
1
6
  0.5.0 / 2022-04-11
2
7
  ==================
3
8
 
4
9
  * Add `priority` option
5
10
  * Fix `expires` option to reject invalid dates
6
- * pref: improve default decode speed
7
- * pref: remove slow string split in parse
11
+ * perf: improve default decode speed
12
+ * perf: remove slow string split in parse
8
13
 
9
14
  0.4.2 / 2022-02-02
10
15
  ==================
11
16
 
12
- * pref: read value only when assigning in parse
13
- * pref: remove unnecessary regexp in parse
17
+ * perf: read value only when assigning in parse
18
+ * perf: remove unnecessary regexp in parse
14
19
 
15
20
  0.4.1 / 2020-04-21
16
21
  ==================
@@ -41,7 +46,7 @@
41
46
 
42
47
  * perf: enable strict mode
43
48
  * perf: use for loop in parse
44
- * perf: use string concatination for serialization
49
+ * perf: use string concatenation for serialization
45
50
 
46
51
  0.2.3 / 2015-10-25
47
52
  ==================
@@ -2,9 +2,9 @@
2
2
 
3
3
  [![NPM Version][npm-version-image]][npm-url]
4
4
  [![NPM Downloads][npm-downloads-image]][npm-url]
5
- [![Node.js Version][node-version-image]][node-version-url]
6
- [![Build Status][github-actions-ci-image]][github-actions-ci-url]
7
- [![Test Coverage][coveralls-image]][coveralls-url]
5
+ [![Node.js Version][node-image]][node-url]
6
+ [![Build Status][ci-image]][ci-url]
7
+ [![Coverage Status][coveralls-image]][coveralls-url]
8
8
 
9
9
  Basic HTTP cookie parser and serializer for HTTP servers.
10
10
 
@@ -107,6 +107,17 @@ The given number will be converted to an integer by rounding down. By default, n
107
107
  `maxAge` are set, then `maxAge` takes precedence, but it is possible not all clients by obey this,
108
108
  so if both are set, they should point to the same date and time.
109
109
 
110
+ ##### partitioned
111
+
112
+ Specifies the `boolean` value for the [`Partitioned` `Set-Cookie`](rfc-cutler-httpbis-partitioned-cookies)
113
+ attribute. When truthy, the `Partitioned` attribute is set, otherwise it is not. By default, the
114
+ `Partitioned` attribute is not set.
115
+
116
+ **note** This is an attribute that has not yet been fully standardized, and may change in the future.
117
+ This also means many clients may ignore this attribute until they understand it.
118
+
119
+ More information about can be found in [the proposal](https://github.com/privacycg/CHIPS).
120
+
110
121
  ##### path
111
122
 
112
123
  Specifies the value for the [`Path` `Set-Cookie` attribute][rfc-6265-5.2.4]. By default, the path
@@ -212,49 +223,52 @@ $ npm test
212
223
  ```
213
224
  $ npm run bench
214
225
 
215
- > cookie@0.4.2 bench
226
+ > cookie@0.5.0 bench
216
227
  > node benchmark/index.js
217
228
 
218
- node@16.14.0
219
- v8@9.4.146.24-node.20
220
- uv@1.43.0
221
- zlib@1.2.11
229
+ node@18.18.2
230
+ acorn@8.10.0
231
+ ada@2.6.0
232
+ ares@1.19.1
222
233
  brotli@1.0.9
223
- ares@1.18.1
224
- modules@93
225
- nghttp2@1.45.1
226
- napi@8
227
- llhttp@6.0.4
228
- openssl@1.1.1m+quic
229
- cldr@40.0
230
- icu@70.1
231
- tz@2021a3
232
- unicode@14.0
233
- ngtcp2@0.1.0-DEV
234
- nghttp3@0.1.0-DEV
234
+ cldr@43.1
235
+ icu@73.2
236
+ llhttp@6.0.11
237
+ modules@108
238
+ napi@9
239
+ nghttp2@1.57.0
240
+ nghttp3@0.7.0
241
+ ngtcp2@0.8.1
242
+ openssl@3.0.10+quic
243
+ simdutf@3.2.14
244
+ tz@2023c
245
+ undici@5.26.3
246
+ unicode@15.0
247
+ uv@1.44.2
248
+ uvwasi@0.0.18
249
+ v8@10.2.154.26-node.26
250
+ zlib@1.2.13.1-motley
235
251
 
236
252
  > node benchmark/parse-top.js
237
253
 
238
254
  cookie.parse - top sites
239
255
 
240
- 15 tests completed.
241
-
242
- parse accounts.google.com x 2,421,245 ops/sec ±0.80% (188 runs sampled)
243
- parse apple.com x 2,684,710 ops/sec ±0.59% (189 runs sampled)
244
- parse cloudflare.com x 2,231,418 ops/sec ±0.76% (186 runs sampled)
245
- parse docs.google.com x 2,316,357 ops/sec ±1.28% (187 runs sampled)
246
- parse drive.google.com x 2,363,543 ops/sec ±0.49% (189 runs sampled)
247
- parse en.wikipedia.org x 839,414 ops/sec ±0.53% (189 runs sampled)
248
- parse linkedin.com x 553,797 ops/sec ±0.63% (190 runs sampled)
249
- parse maps.google.com x 1,314,779 ops/sec ±0.72% (189 runs sampled)
250
- parse microsoft.com x 153,783 ops/sec ±0.53% (190 runs sampled)
251
- parse play.google.com x 2,249,574 ops/sec ±0.59% (187 runs sampled)
252
- parse plus.google.com x 2,258,682 ops/sec ±0.60% (188 runs sampled)
253
- parse sites.google.com x 2,247,069 ops/sec ±0.68% (189 runs sampled)
254
- parse support.google.com x 1,456,840 ops/sec ±0.70% (187 runs sampled)
255
- parse www.google.com x 1,046,028 ops/sec ±0.58% (188 runs sampled)
256
- parse youtu.be x 937,428 ops/sec ±1.47% (190 runs sampled)
257
- parse youtube.com x 963,878 ops/sec ±0.59% (190 runs sampled)
256
+ 14 tests completed.
257
+
258
+ parse accounts.google.com x 2,588,913 ops/sec ±0.74% (186 runs sampled)
259
+ parse apple.com x 2,370,002 ops/sec ±0.69% (186 runs sampled)
260
+ parse cloudflare.com x 2,213,102 ops/sec ±0.88% (188 runs sampled)
261
+ parse docs.google.com x 2,194,157 ops/sec ±1.03% (184 runs sampled)
262
+ parse drive.google.com x 2,265,084 ops/sec ±0.79% (187 runs sampled)
263
+ parse en.wikipedia.org x 457,099 ops/sec ±0.81% (186 runs sampled)
264
+ parse linkedin.com x 504,407 ops/sec ±0.89% (186 runs sampled)
265
+ parse maps.google.com x 1,230,959 ops/sec ±0.98% (186 runs sampled)
266
+ parse microsoft.com x 926,294 ops/sec ±0.88% (184 runs sampled)
267
+ parse play.google.com x 2,311,338 ops/sec ±0.83% (185 runs sampled)
268
+ parse support.google.com x 1,508,850 ops/sec ±0.86% (186 runs sampled)
269
+ parse www.google.com x 1,022,582 ops/sec ±1.32% (182 runs sampled)
270
+ parse youtu.be x 332,136 ops/sec ±1.02% (185 runs sampled)
271
+ parse youtube.com x 323,833 ops/sec ±0.77% (183 runs sampled)
258
272
 
259
273
  > node benchmark/parse.js
260
274
 
@@ -262,12 +276,12 @@ $ npm run bench
262
276
 
263
277
  6 tests completed.
264
278
 
265
- simple x 2,745,604 ops/sec ±0.77% (185 runs sampled)
266
- decode x 557,287 ops/sec ±0.60% (188 runs sampled)
267
- unquote x 2,498,475 ops/sec ±0.55% (189 runs sampled)
268
- duplicates x 868,591 ops/sec ±0.89% (187 runs sampled)
269
- 10 cookies x 306,745 ops/sec ±0.49% (190 runs sampled)
270
- 100 cookies x 22,414 ops/sec ±2.38% (182 runs sampled)
279
+ simple x 3,214,032 ops/sec ±1.61% (183 runs sampled)
280
+ decode x 587,237 ops/sec ±1.16% (187 runs sampled)
281
+ unquote x 2,954,618 ops/sec ±1.35% (183 runs sampled)
282
+ duplicates x 857,008 ops/sec ±0.89% (187 runs sampled)
283
+ 10 cookies x 292,133 ops/sec ±0.89% (187 runs sampled)
284
+ 100 cookies x 22,610 ops/sec ±0.68% (187 runs sampled)
271
285
  ```
272
286
 
273
287
  ## References
@@ -275,6 +289,7 @@ $ npm run bench
275
289
  - [RFC 6265: HTTP State Management Mechanism][rfc-6265]
276
290
  - [Same-site Cookies][rfc-6265bis-09-5.4.7]
277
291
 
292
+ [rfc-cutler-httpbis-partitioned-cookies]: https://tools.ietf.org/html/draft-cutler-httpbis-partitioned-cookies/
278
293
  [rfc-west-cookie-priority-00-4.1]: https://tools.ietf.org/html/draft-west-cookie-priority-00#section-4.1
279
294
  [rfc-6265bis-09-5.4.7]: https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-09#section-5.4.7
280
295
  [rfc-6265]: https://tools.ietf.org/html/rfc6265
@@ -291,12 +306,12 @@ $ npm run bench
291
306
 
292
307
  [MIT](LICENSE)
293
308
 
309
+ [ci-image]: https://badgen.net/github/checks/jshttp/cookie/master?label=ci
310
+ [ci-url]: https://github.com/jshttp/cookie/actions/workflows/ci.yml
294
311
  [coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/cookie/master
295
312
  [coveralls-url]: https://coveralls.io/r/jshttp/cookie?branch=master
296
- [github-actions-ci-image]: https://img.shields.io/github/workflow/status/jshttp/cookie/ci/master?label=ci
297
- [github-actions-ci-url]: https://github.com/jshttp/cookie/actions/workflows/ci.yml
298
- [node-version-image]: https://badgen.net/npm/node/cookie
299
- [node-version-url]: https://nodejs.org/en/download
313
+ [node-image]: https://badgen.net/npm/node/cookie
314
+ [node-url]: https://nodejs.org/en/download
300
315
  [npm-downloads-image]: https://badgen.net/npm/dm/cookie
301
316
  [npm-url]: https://npmjs.org/package/cookie
302
317
  [npm-version-image]: https://badgen.net/npm/v/cookie
@@ -172,6 +172,10 @@ function serialize(name, val, options) {
172
172
  str += '; Secure';
173
173
  }
174
174
 
175
+ if (opt.partitioned) {
176
+ str += '; Partitioned'
177
+ }
178
+
175
179
  if (opt.priority) {
176
180
  var priority = typeof opt.priority === 'string'
177
181
  ? opt.priority.toLowerCase()
@@ -233,7 +237,7 @@ function decode (str) {
233
237
  /**
234
238
  * URL-encode value.
235
239
  *
236
- * @param {string} str
240
+ * @param {string} val
237
241
  * @returns {string}
238
242
  */
239
243
 
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cookie",
3
3
  "description": "HTTP server cookie parsing and serialization",
4
- "version": "0.5.0",
4
+ "version": "0.6.0",
5
5
  "author": "Roman Shtylman <shtylman@gmail.com>",
6
6
  "contributors": [
7
7
  "Douglas Christopher Wilson <doug@somethingdoug.com>"
@@ -15,12 +15,12 @@
15
15
  "devDependencies": {
16
16
  "beautify-benchmark": "0.2.4",
17
17
  "benchmark": "2.1.4",
18
- "eslint": "7.32.0",
19
- "eslint-plugin-markdown": "2.2.1",
20
- "mocha": "9.2.2",
18
+ "eslint": "8.53.0",
19
+ "eslint-plugin-markdown": "3.0.1",
20
+ "mocha": "10.2.0",
21
21
  "nyc": "15.1.0",
22
22
  "safe-buffer": "5.2.1",
23
- "top-sites": "1.1.97"
23
+ "top-sites": "1.1.194"
24
24
  },
25
25
  "files": [
26
26
  "HISTORY.md",
@@ -1,4 +1,20 @@
1
- 4.18.3 / 2024-02-26
1
+ 4.19.2 / 2024-03-25
2
+ ==========
3
+
4
+ * Improved fix for open redirect allow list bypass
5
+
6
+ 4.19.1 / 2024-03-20
7
+ ==========
8
+
9
+ * Allow passing non-strings to res.location with new encoding handling checks
10
+
11
+ 4.19.0 / 2024-03-20
12
+ ==========
13
+
14
+ * Prevent open redirect allow list bypass due to encodeurl
15
+ * deps: cookie@0.6.0
16
+
17
+ 4.18.3 / 2024-02-29
2
18
  ==========
3
19
 
4
20
  * Fix routing requests without method
@@ -6,6 +22,8 @@
6
22
  - Fix strict json error message on Node.js 19+
7
23
  - deps: content-type@~1.0.5
8
24
  - deps: raw-body@2.5.2
25
+ * deps: cookie@0.6.0
26
+ - Add `partitioned` option
9
27
 
10
28
  4.18.2 / 2022-10-08
11
29
  ===================
@@ -55,6 +55,7 @@ module.exports = res
55
55
  */
56
56
 
57
57
  var charsetRegExp = /;\s*charset\s*=/;
58
+ var schemaAndHostRegExp = /^(?:[a-zA-Z][a-zA-Z0-9+.-]*:)?\/\/[^\\\/\?]+/;
58
59
 
59
60
  /**
60
61
  * Set status `code`.
@@ -904,15 +905,23 @@ res.cookie = function (name, value, options) {
904
905
  */
905
906
 
906
907
  res.location = function location(url) {
907
- var loc = url;
908
+ var loc;
908
909
 
909
910
  // "back" is an alias for the referrer
910
911
  if (url === 'back') {
911
912
  loc = this.req.get('Referrer') || '/';
913
+ } else {
914
+ loc = String(url);
912
915
  }
913
916
 
914
- // set location
915
- return this.set('Location', encodeUrl(loc));
917
+ var m = schemaAndHostRegExp.exec(loc);
918
+ var pos = m ? m[0].length + 1 : 0;
919
+
920
+ // Only encode after host to avoid invalid encoding which can introduce
921
+ // vulnerabilities (e.g. `\\` to `%5C`).
922
+ loc = loc.slice(0, pos) + encodeUrl(loc.slice(pos));
923
+
924
+ return this.set('Location', loc);
916
925
  };
917
926
 
918
927
  /**
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "express",
3
3
  "description": "Fast, unopinionated, minimalist web framework",
4
- "version": "4.18.3",
4
+ "version": "4.19.2",
5
5
  "author": "TJ Holowaychuk <tj@vision-media.ca>",
6
6
  "contributors": [
7
7
  "Aaron Heckmann <aaron.heckmann+github@gmail.com>",
@@ -33,7 +33,7 @@
33
33
  "body-parser": "1.20.2",
34
34
  "content-disposition": "0.5.4",
35
35
  "content-type": "~1.0.4",
36
- "cookie": "0.5.0",
36
+ "cookie": "0.6.0",
37
37
  "cookie-signature": "1.0.6",
38
38
  "debug": "2.6.9",
39
39
  "depd": "2.0.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "step-node-agent",
3
- "version": "3.24.4",
3
+ "version": "3.24.5",
4
4
  "description": "The official STEP Agent implementation for Node.js",
5
5
  "main": "index.js",
6
6
  "scripts": {