@dynamic-labs-wallet/browser-wallet-client 1.0.64 → 1.0.66
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.
package/index.cjs
CHANGED
|
@@ -476,6 +476,31 @@ const createIframeWaasSDKContainer = ()=>{
|
|
|
476
476
|
};
|
|
477
477
|
};
|
|
478
478
|
|
|
479
|
+
/**
|
|
480
|
+
* Cookie-mode isolation guard: the key-share iframe must never share an origin
|
|
481
|
+
* with the embedding page — a same-origin parent can read the iframe's DOM and
|
|
482
|
+
* storage directly, collapsing the boundary that keeps client key shares out of
|
|
483
|
+
* reach of host-page XSS. This only happens when the app itself is served from
|
|
484
|
+
* the cookie hostname (e.g. a reverse proxy routing both the app and Dynamic's
|
|
485
|
+
* API through one hostname), so refuse to boot instead of running without the
|
|
486
|
+
* boundary. No-op off-web (React Native), where no location/DOM access exists.
|
|
487
|
+
*/ const assertIframeOriginIsolated = (iframeDomain)=>{
|
|
488
|
+
var _globalThis_location;
|
|
489
|
+
const hostOrigin = (_globalThis_location = globalThis.location) == null ? void 0 : _globalThis_location.origin;
|
|
490
|
+
if (!hostOrigin) {
|
|
491
|
+
return;
|
|
492
|
+
}
|
|
493
|
+
let iframeOrigin;
|
|
494
|
+
try {
|
|
495
|
+
iframeOrigin = new URL(iframeDomain).origin;
|
|
496
|
+
} catch (e) {
|
|
497
|
+
// Malformed baseApiUrl surfaces as a clearer iframe load failure later.
|
|
498
|
+
return;
|
|
499
|
+
}
|
|
500
|
+
if (iframeOrigin === hostOrigin) {
|
|
501
|
+
throw new Error(`Cookie auth misconfiguration: the wallet iframe origin (${iframeOrigin}) is the same as the host page origin. ` + 'The cookie domain must be a dedicated hostname CNAMEd to Dynamic (e.g. auth.example.com) that never serves ' + 'your application — a same-origin setup would let the host page read the wallet key-share storage.');
|
|
502
|
+
}
|
|
503
|
+
};
|
|
479
504
|
/**
|
|
480
505
|
* Resolve the wallet iframe domain from the API base URL: the
|
|
481
506
|
* environment-mapped Dynamic domain, or `baseApiUrl` itself in cookie auth
|
|
@@ -1406,6 +1431,11 @@ class IframeManager {
|
|
|
1406
1431
|
baseApiUrl,
|
|
1407
1432
|
authMode: this.authMode
|
|
1408
1433
|
});
|
|
1434
|
+
// Cookie mode serves the iframe from the customer's cookie hostname; refuse
|
|
1435
|
+
// to boot if that origin is the embedding page's own origin (see the guard).
|
|
1436
|
+
if (this.authMode === core.AuthMode.COOKIE && this.iframeDomain) {
|
|
1437
|
+
assertIframeOriginIsolated(this.iframeDomain);
|
|
1438
|
+
}
|
|
1409
1439
|
// Fallback warmup: only saves connection setup when the host constructs
|
|
1410
1440
|
// the client ahead of use. Hosts should call `preconnectWaasIframe` at
|
|
1411
1441
|
// auth-flow start for real runway. No-op on React Native.
|
package/index.esm.js
CHANGED
|
@@ -475,6 +475,31 @@ const createIframeWaasSDKContainer = ()=>{
|
|
|
475
475
|
};
|
|
476
476
|
};
|
|
477
477
|
|
|
478
|
+
/**
|
|
479
|
+
* Cookie-mode isolation guard: the key-share iframe must never share an origin
|
|
480
|
+
* with the embedding page — a same-origin parent can read the iframe's DOM and
|
|
481
|
+
* storage directly, collapsing the boundary that keeps client key shares out of
|
|
482
|
+
* reach of host-page XSS. This only happens when the app itself is served from
|
|
483
|
+
* the cookie hostname (e.g. a reverse proxy routing both the app and Dynamic's
|
|
484
|
+
* API through one hostname), so refuse to boot instead of running without the
|
|
485
|
+
* boundary. No-op off-web (React Native), where no location/DOM access exists.
|
|
486
|
+
*/ const assertIframeOriginIsolated = (iframeDomain)=>{
|
|
487
|
+
var _globalThis_location;
|
|
488
|
+
const hostOrigin = (_globalThis_location = globalThis.location) == null ? void 0 : _globalThis_location.origin;
|
|
489
|
+
if (!hostOrigin) {
|
|
490
|
+
return;
|
|
491
|
+
}
|
|
492
|
+
let iframeOrigin;
|
|
493
|
+
try {
|
|
494
|
+
iframeOrigin = new URL(iframeDomain).origin;
|
|
495
|
+
} catch (e) {
|
|
496
|
+
// Malformed baseApiUrl surfaces as a clearer iframe load failure later.
|
|
497
|
+
return;
|
|
498
|
+
}
|
|
499
|
+
if (iframeOrigin === hostOrigin) {
|
|
500
|
+
throw new Error(`Cookie auth misconfiguration: the wallet iframe origin (${iframeOrigin}) is the same as the host page origin. ` + 'The cookie domain must be a dedicated hostname CNAMEd to Dynamic (e.g. auth.example.com) that never serves ' + 'your application — a same-origin setup would let the host page read the wallet key-share storage.');
|
|
501
|
+
}
|
|
502
|
+
};
|
|
478
503
|
/**
|
|
479
504
|
* Resolve the wallet iframe domain from the API base URL: the
|
|
480
505
|
* environment-mapped Dynamic domain, or `baseApiUrl` itself in cookie auth
|
|
@@ -1405,6 +1430,11 @@ class IframeManager {
|
|
|
1405
1430
|
baseApiUrl,
|
|
1406
1431
|
authMode: this.authMode
|
|
1407
1432
|
});
|
|
1433
|
+
// Cookie mode serves the iframe from the customer's cookie hostname; refuse
|
|
1434
|
+
// to boot if that origin is the embedding page's own origin (see the guard).
|
|
1435
|
+
if (this.authMode === AuthMode.COOKIE && this.iframeDomain) {
|
|
1436
|
+
assertIframeOriginIsolated(this.iframeDomain);
|
|
1437
|
+
}
|
|
1408
1438
|
// Fallback warmup: only saves connection setup when the host constructs
|
|
1409
1439
|
// the client ahead of use. Hosts should call `preconnectWaasIframe` at
|
|
1410
1440
|
// auth-flow start for real runway. No-op on React Native.
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs-wallet/browser-wallet-client",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.66",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@dynamic-labs-wallet/core": "1.0.
|
|
7
|
+
"@dynamic-labs-wallet/core": "1.0.66",
|
|
8
8
|
"@dynamic-labs/logger": "^4.81.0",
|
|
9
9
|
"@dynamic-labs/message-transport": "^4.81.0"
|
|
10
10
|
},
|
|
@@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AAC;QACpC,OAAO,EAAE,MAAM,IAAI,CAAC;KACrB,CAAC;IAqCW,OAAO;CAoCrB"}
|
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
import { AuthMode } from '@dynamic-labs-wallet/core';
|
|
2
|
+
/**
|
|
3
|
+
* Cookie-mode isolation guard: the key-share iframe must never share an origin
|
|
4
|
+
* with the embedding page — a same-origin parent can read the iframe's DOM and
|
|
5
|
+
* storage directly, collapsing the boundary that keeps client key shares out of
|
|
6
|
+
* reach of host-page XSS. This only happens when the app itself is served from
|
|
7
|
+
* the cookie hostname (e.g. a reverse proxy routing both the app and Dynamic's
|
|
8
|
+
* API through one hostname), so refuse to boot instead of running without the
|
|
9
|
+
* boundary. No-op off-web (React Native), where no location/DOM access exists.
|
|
10
|
+
*/
|
|
11
|
+
export declare const assertIframeOriginIsolated: (iframeDomain: string) => void;
|
|
2
12
|
/**
|
|
3
13
|
* Resolve the wallet iframe domain from the API base URL: the
|
|
4
14
|
* environment-mapped Dynamic domain, or `baseApiUrl` itself in cookie auth
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveIframeDomain.d.ts","sourceRoot":"","sources":["../../../src/client/iframeManager/resolveIframeDomain.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAA4C,MAAM,2BAA2B,CAAC;AAE/F;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,8BAG7B;IACD,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,QAAQ,CAAC;CACpB,KAAG,MAAM,GAAG,IAKZ,CAAC"}
|
|
1
|
+
{"version":3,"file":"resolveIframeDomain.d.ts","sourceRoot":"","sources":["../../../src/client/iframeManager/resolveIframeDomain.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAA4C,MAAM,2BAA2B,CAAC;AAE/F;;;;;;;;GAQG;AACH,eAAO,MAAM,0BAA0B,iBAAkB,MAAM,KAAG,IAmBjE,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,8BAG7B;IACD,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,QAAQ,CAAC;CACpB,KAAG,MAAM,GAAG,IAKZ,CAAC"}
|