| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 97c8a96 commit 3f0d737
7 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2758,9 +2758,15 @@ added: v23.8.0 | |||
| 2758 | 2758 | --> | |
| 2759 | 2759 | ||
| 2760 | 2760 | * Type: {string} One of `'use'`, `'ignore'`, or `'default'`. | |
| 2761 | + * **Default:** `'ignore'` | ||
| 2761 | 2762 | ||
| 2762 | 2763 | When the remote peer advertises a preferred address, this option specifies whether | |
| 2763 | - to use it or ignore it. | ||
| 2764 | + to use it or ignore it. The default is `'ignore'` because honoring a server's | ||
| 2765 | + preferred address causes the client to migrate its connection to a different IP | ||
| 2766 | + address, which can be exploited for data exfiltration attacks that are | ||
| 2767 | + indistinguishable from legitimate QUIC connection migration at the network level. | ||
| 2768 | + Set to `'use'` only when connecting to trusted servers that require preferred | ||
| 2769 | + address migration. | ||
| 2764 | 2770 | ||
| 2765 | 2771 | #### `sessionOptions.qlog` | |
| 2766 | 2772 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4919,7 +4919,7 @@ function processSessionOptions(options, config = kEmptyObject) { | |||
| 4919 | 4919 | reuseEndpoint = true, | |
| 4920 | 4920 | version, | |
| 4921 | 4921 | minVersion, | |
| 4922 | - preferredAddressPolicy = 'default', | ||
| 4922 | + preferredAddressPolicy = 'ignore', | ||
| 4923 | 4923 | transportParams = kEmptyObject, | |
| 4924 | 4924 | qlog = false, | |
| 4925 | 4925 | sessionTicket, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -140,7 +140,7 @@ void PreferredAddress::Initialize(Environment* env, Local<Object> target) { | |||
| 140 | 140 | static constexpr auto PREFERRED_ADDRESS_IGNORE = | |
| 141 | 141 | static_cast<uint8_t>(Policy::IGNORE_PREFERRED); | |
| 142 | 142 | static constexpr auto DEFAULT_PREFERRED_ADDRESS_POLICY = | |
| 143 | - static_cast<uint8_t>(Policy::USE_PREFERRED); | ||
| 143 | + static_cast<uint8_t>(Policy::IGNORE_PREFERRED); | ||
| 144 | 144 | ||
| 145 | 145 | NODE_DEFINE_CONSTANT(target, PREFERRED_ADDRESS_IGNORE); | |
| 146 | 146 | NODE_DEFINE_CONSTANT(target, PREFERRED_ADDRESS_USE); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -36,6 +36,7 @@ const serverEndpoint = await listen(mustCall(async (serverSession) => { | |||
| 36 | 36 | ||
| 37 | 37 | const clientSession = await connect(serverEndpoint.address, { | |
| 38 | 38 | reuseEndpoint: false, | |
| 39 | + preferredAddressPolicy: 'use', | ||
| 39 | 40 | onpathvalidation() { | |
| 40 | 41 | throw testError; | |
| 41 | 42 | }, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -47,6 +47,7 @@ const serverEndpoint = await listen(mustCall(async (serverSession) => { | |||
| 47 | 47 | ||
| 48 | 48 | const clientSession = await connect(serverEndpoint.address, { | |
| 49 | 49 | reuseEndpoint: false, | |
| 50 | + preferredAddressPolicy: 'use', | ||
| 50 | 51 | // The onpathvalidation must be set for the JS handler to fire, | |
| 51 | 52 | // which in turn publishes to the diagnostics channel. | |
| 52 | 53 | onpathvalidation: mustCall(), | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -81,6 +81,7 @@ console.log(serverEndpoint.address); | |||
| 81 | 81 | const clientSession = await connect(serverEndpoint.address, { | |
| 82 | 82 | // We don't want this endpoint to reuse either of the two listening endpoints. | |
| 83 | 83 | reuseEndpoint: false, | |
| 84 | + preferredAddressPolicy: 'use', | ||
| 84 | 85 | transportParams: { maxDatagramFrameSize: 1200 }, | |
| 85 | 86 | ondatagramstatus: mustCall((id, status) => { | |
| 86 | 87 | if (++statusCount >= 4) allStatusDone.resolve(); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -65,6 +65,7 @@ const serverEndpoint = await listen(handleSession, { | |||
| 65 | 65 | const clientSession = await connect(serverEndpoint.address, { | |
| 66 | 66 | // We don't want this endpoint to reuse either of the two listening endpoints. | |
| 67 | 67 | reuseEndpoint: false, | |
| 68 | + preferredAddressPolicy: 'use', | ||
| 68 | 69 | transportParams: { maxDatagramFrameSize: 1200 }, | |
| 69 | 70 | ondatagramstatus: mustCall((id, status) => { | |
| 70 | 71 | if (++statusCount >= 4) allStatusDone.resolve(); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments