@fedify/fedify 0.10.1 → 0.10.2

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.
Files changed (36) hide show
  1. package/CHANGES.md +30 -0
  2. package/esm/runtime/key.js +1 -1
  3. package/esm/runtime/url.js +9 -5
  4. package/esm/sig/http.js +1 -1
  5. package/package.json +1 -1
  6. package/types/deps/jsr.io/@std/bytes/{1.0.1 → 1.0.2}/concat.d.ts.map +1 -1
  7. package/types/deps/jsr.io/@std/bytes/{1.0.1 → 1.0.2}/copy.d.ts.map +1 -1
  8. package/types/deps/jsr.io/@std/bytes/{1.0.1 → 1.0.2}/ends_with.d.ts.map +1 -1
  9. package/types/deps/jsr.io/@std/bytes/{1.0.1 → 1.0.2}/equals.d.ts.map +1 -1
  10. package/types/deps/jsr.io/@std/bytes/{1.0.1 → 1.0.2}/includes_needle.d.ts.map +1 -1
  11. package/types/deps/jsr.io/@std/bytes/{1.0.1 → 1.0.2}/index_of_needle.d.ts.map +1 -1
  12. package/types/deps/jsr.io/@std/bytes/{1.0.1 → 1.0.2}/last_index_of_needle.d.ts.map +1 -1
  13. package/types/deps/jsr.io/@std/bytes/{1.0.1 → 1.0.2}/mod.d.ts.map +1 -1
  14. package/types/deps/jsr.io/@std/bytes/{1.0.1 → 1.0.2}/repeat.d.ts.map +1 -1
  15. package/types/deps/jsr.io/@std/bytes/{1.0.1 → 1.0.2}/starts_with.d.ts.map +1 -1
  16. package/types/runtime/url.d.ts.map +1 -1
  17. /package/esm/deps/jsr.io/@std/bytes/{1.0.1 → 1.0.2}/concat.js +0 -0
  18. /package/esm/deps/jsr.io/@std/bytes/{1.0.1 → 1.0.2}/copy.js +0 -0
  19. /package/esm/deps/jsr.io/@std/bytes/{1.0.1 → 1.0.2}/ends_with.js +0 -0
  20. /package/esm/deps/jsr.io/@std/bytes/{1.0.1 → 1.0.2}/equals.js +0 -0
  21. /package/esm/deps/jsr.io/@std/bytes/{1.0.1 → 1.0.2}/includes_needle.js +0 -0
  22. /package/esm/deps/jsr.io/@std/bytes/{1.0.1 → 1.0.2}/index_of_needle.js +0 -0
  23. /package/esm/deps/jsr.io/@std/bytes/{1.0.1 → 1.0.2}/last_index_of_needle.js +0 -0
  24. /package/esm/deps/jsr.io/@std/bytes/{1.0.1 → 1.0.2}/mod.js +0 -0
  25. /package/esm/deps/jsr.io/@std/bytes/{1.0.1 → 1.0.2}/repeat.js +0 -0
  26. /package/esm/deps/jsr.io/@std/bytes/{1.0.1 → 1.0.2}/starts_with.js +0 -0
  27. /package/types/deps/jsr.io/@std/bytes/{1.0.1 → 1.0.2}/concat.d.ts +0 -0
  28. /package/types/deps/jsr.io/@std/bytes/{1.0.1 → 1.0.2}/copy.d.ts +0 -0
  29. /package/types/deps/jsr.io/@std/bytes/{1.0.1 → 1.0.2}/ends_with.d.ts +0 -0
  30. /package/types/deps/jsr.io/@std/bytes/{1.0.1 → 1.0.2}/equals.d.ts +0 -0
  31. /package/types/deps/jsr.io/@std/bytes/{1.0.1 → 1.0.2}/includes_needle.d.ts +0 -0
  32. /package/types/deps/jsr.io/@std/bytes/{1.0.1 → 1.0.2}/index_of_needle.d.ts +0 -0
  33. /package/types/deps/jsr.io/@std/bytes/{1.0.1 → 1.0.2}/last_index_of_needle.d.ts +0 -0
  34. /package/types/deps/jsr.io/@std/bytes/{1.0.1 → 1.0.2}/mod.d.ts +0 -0
  35. /package/types/deps/jsr.io/@std/bytes/{1.0.1 → 1.0.2}/repeat.d.ts +0 -0
  36. /package/types/deps/jsr.io/@std/bytes/{1.0.1 → 1.0.2}/starts_with.d.ts +0 -0
package/CHANGES.md CHANGED
@@ -3,6 +3,21 @@
3
3
  Fedify changelog
4
4
  ================
5
5
 
6
+ Version 0.10.2
7
+ --------------
8
+
9
+ Released on July 9, 2024.
10
+
11
+ - Fixed a vulnerability of SSRF via DNS rebinding in the built-in document
12
+ loader. [[CVE-2024-39687]]
13
+
14
+ - The `fetchDocumentLoader()` function now throws an error when the given
15
+ domain name has any records referring to a private network address.
16
+ - The `getAuthenticatedDocumentLoader()` function now returns a document
17
+ loader that throws an error when the given domain name has any records
18
+ referring to a private network address.
19
+
20
+
6
21
  Version 0.10.1
7
22
  --------------
8
23
 
@@ -179,6 +194,21 @@ is now distributed under the [MIT License] to encourage wider adoption.
179
194
  [x-forwarded-fetch]: https://github.com/dahlia/x-forwarded-fetch
180
195
 
181
196
 
197
+ Version 0.9.3
198
+ -------------
199
+
200
+ Released on July 9, 2024.
201
+
202
+ - Fixed a vulnerability of SSRF via DNS rebinding in the built-in document
203
+ loader. [[CVE-2024-39687]]
204
+
205
+ - The `fetchDocumentLoader()` function now throws an error when the given
206
+ domain name has any records referring to a private network address.
207
+ - The `getAuthenticatedDocumentLoader()` function now returns a document
208
+ loader that throws an error when the given domain name has any records
209
+ referring to a private network address.
210
+
211
+
182
212
  Version 0.9.2
183
213
  -------------
184
214
 
@@ -1,6 +1,6 @@
1
1
  import * as dntShim from "../_dnt.shims.js";
2
2
  import { createPublicKey } from "node:crypto";
3
- import { concat } from "../deps/jsr.io/@std/bytes/1.0.1/concat.js";
3
+ import { concat } from "../deps/jsr.io/@std/bytes/1.0.2/concat.js";
4
4
  import { decodeBase64, encodeBase64 } from "../deps/jsr.io/@std/encoding/0.224.3/base64.js";
5
5
  import { decodeBase64Url } from "../deps/jsr.io/@std/encoding/0.224.3/base64url.js";
6
6
  import { decodeHex } from "../deps/jsr.io/@std/encoding/0.224.3/hex.js";
@@ -30,11 +30,15 @@ export async function validatePublicUrl(url) {
30
30
  if (netPermission.state !== "granted")
31
31
  return;
32
32
  }
33
- const { address, family } = await lookup(hostname);
34
- if (family === 4 && !isValidPublicIPv4Address(address) ||
35
- family === 6 && !isValidPublicIPv6Address(address) ||
36
- family < 4 || family === 5 || family > 6) {
37
- throw new UrlError(`Invalid or private address: ${address}`);
33
+ // To prevent SSRF via DNS rebinding, we need to resolve all IP addresses
34
+ // and ensure that they are all public:
35
+ const addresses = await lookup(hostname, { all: true });
36
+ for (const { address, family } of addresses) {
37
+ if (family === 4 && !isValidPublicIPv4Address(address) ||
38
+ family === 6 && !isValidPublicIPv6Address(address) ||
39
+ family < 4 || family === 5 || family > 6) {
40
+ throw new UrlError(`Invalid or private address: ${address}`);
41
+ }
38
42
  }
39
43
  }
40
44
  export function isValidPublicIPv4Address(address) {
package/esm/sig/http.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as dntShim from "../_dnt.shims.js";
2
2
  import { getLogger } from "@logtape/logtape";
3
- import { equals } from "../deps/jsr.io/@std/bytes/1.0.1/mod.js";
3
+ import { equals } from "../deps/jsr.io/@std/bytes/1.0.2/mod.js";
4
4
  import { decodeBase64, encodeBase64 } from "../deps/jsr.io/@std/encoding/0.224.3/base64.js";
5
5
  import { CryptographicKey } from "../vocab/vocab.js";
6
6
  import { fetchKey, validateCryptoKey } from "./key.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fedify/fedify",
3
- "version": "0.10.1",
3
+ "version": "0.10.2",
4
4
  "description": "An ActivityPub server framework",
5
5
  "keywords": [
6
6
  "ActivityPub",
@@ -1 +1 @@
1
- {"version":3,"file":"concat.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/bytes/1.0.1/concat.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,MAAM,CAAC,OAAO,EAAE,UAAU,EAAE,GAAG,UAAU,CAaxD"}
1
+ {"version":3,"file":"concat.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/bytes/1.0.2/concat.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,MAAM,CAAC,OAAO,EAAE,UAAU,EAAE,GAAG,UAAU,CAaxD"}
@@ -1 +1 @@
1
- {"version":3,"file":"copy.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/bytes/1.0.1/copy.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,wBAAgB,IAAI,CAAC,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,SAAI,GAAG,MAAM,CAQzE"}
1
+ {"version":3,"file":"copy.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/bytes/1.0.2/copy.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,wBAAgB,IAAI,CAAC,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,SAAI,GAAG,MAAM,CAQzE"}
@@ -1 +1 @@
1
- {"version":3,"file":"ends_with.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/bytes/1.0.1/ends_with.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,GAAG,OAAO,CAWxE"}
1
+ {"version":3,"file":"ends_with.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/bytes/1.0.2/ends_with.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,GAAG,OAAO,CAWxE"}
@@ -1 +1 @@
1
- {"version":3,"file":"equals.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/bytes/1.0.1/equals.ts"],"names":[],"mappings":"AA6DA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,MAAM,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,GAAG,OAAO,CAQ5D"}
1
+ {"version":3,"file":"equals.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/bytes/1.0.2/equals.ts"],"names":[],"mappings":"AA6DA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,MAAM,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,GAAG,OAAO,CAQ5D"}
@@ -1 +1 @@
1
- {"version":3,"file":"includes_needle.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/bytes/1.0.1/includes_needle.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,UAAU,EAClB,MAAM,EAAE,UAAU,EAClB,KAAK,SAAI,GACR,OAAO,CAET"}
1
+ {"version":3,"file":"includes_needle.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/bytes/1.0.2/includes_needle.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,UAAU,EAClB,MAAM,EAAE,UAAU,EAClB,KAAK,SAAI,GACR,OAAO,CAET"}
@@ -1 +1 @@
1
- {"version":3,"file":"index_of_needle.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/bytes/1.0.1/index_of_needle.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,UAAU,EAClB,MAAM,EAAE,UAAU,EAClB,KAAK,SAAI,GACR,MAAM,CAqBR"}
1
+ {"version":3,"file":"index_of_needle.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/bytes/1.0.2/index_of_needle.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,UAAU,EAClB,MAAM,EAAE,UAAU,EAClB,KAAK,SAAI,GACR,MAAM,CAqBR"}
@@ -1 +1 @@
1
- {"version":3,"file":"last_index_of_needle.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/bytes/1.0.1/last_index_of_needle.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,UAAU,EAClB,MAAM,EAAE,UAAU,EAClB,KAAK,GAAE,MAA0B,GAChC,MAAM,CAuBR"}
1
+ {"version":3,"file":"last_index_of_needle.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/bytes/1.0.2/last_index_of_needle.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,UAAU,EAClB,MAAM,EAAE,UAAU,EAClB,KAAK,GAAE,MAA0B,GAChC,MAAM,CAuBR"}
@@ -1 +1 @@
1
- {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/bytes/1.0.1/mod.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/bytes/1.0.2/mod.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"repeat.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/bytes/1.0.1/repeat.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,MAAM,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,GAAG,UAAU,CAapE"}
1
+ {"version":3,"file":"repeat.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/bytes/1.0.2/repeat.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,MAAM,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,GAAG,UAAU,CAapE"}
@@ -1 +1 @@
1
- {"version":3,"file":"starts_with.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/bytes/1.0.1/starts_with.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,GAAG,OAAO,CAS1E"}
1
+ {"version":3,"file":"starts_with.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/bytes/1.0.2/starts_with.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,GAAG,OAAO,CAS1E"}
@@ -1 +1 @@
1
- {"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../src/runtime/url.ts"],"names":[],"mappings":"AAIA,qBAAa,QAAS,SAAQ,KAAK;gBACrB,OAAO,EAAE,MAAM;CAI5B;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA2BlE;AAED,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CASjE;AAED,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,WASvD;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAWzD"}
1
+ {"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../src/runtime/url.ts"],"names":[],"mappings":"AAIA,qBAAa,QAAS,SAAQ,KAAK;gBACrB,OAAO,EAAE,MAAM;CAI5B;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA+BlE;AAED,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CASjE;AAED,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,WASvD;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAWzD"}