diff --git a/backend/package.json b/backend/package.json index 11c0ff26..791b149f 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "sub-store", - "version": "2.21.57", + "version": "2.21.58", "description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.", "main": "src/main.js", "scripts": { diff --git a/backend/src/core/proxy-utils/producers/uri.js b/backend/src/core/proxy-utils/producers/uri.js index 52fe4c5d..637eebc9 100644 --- a/backend/src/core/proxy-utils/producers/uri.js +++ b/backend/src/core/proxy-utils/producers/uri.js @@ -807,7 +807,9 @@ export default function URI_Producer() { ].includes(key) ) { if (['public-key'].includes(key)) { - wireguardParams.push(`publickey=${proxy[key]}`); + wireguardParams.push( + `publickey=${encodeURIComponent(proxy[key])}`, + ); } else if (['udp'].includes(key)) { if (proxy[key]) { wireguardParams.push(`${key}=1`); @@ -821,12 +823,18 @@ export default function URI_Producer() { }); if (proxy.ip && proxy.ipv6) { wireguardParams.push( - `address=${proxy.ip}/32,${proxy.ipv6}/128`, + `address=${encodeURIComponent( + `${proxy.ip}/32,${proxy.ipv6}/128`, + )}`, ); } else if (proxy.ip) { - wireguardParams.push(`address=${proxy.ip}/32`); + wireguardParams.push( + `address=${encodeURIComponent(`${proxy.ip}/32`)}`, + ); } else if (proxy.ipv6) { - wireguardParams.push(`address=${proxy.ipv6}/128`); + wireguardParams.push( + `address=${encodeURIComponent(`${proxy.ipv6}/128`)}`, + ); } result = `wireguard://${encodeURIComponent( proxy['private-key'],