@ai-ecoverse/slicc-browsers 1.26.4 → 1.27.0
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/README.md +8 -6
- package/catalog.json +4 -0
- package/credential-export.mjs +1359 -0
- package/fixture-server.mjs +5 -0
- package/guard-driver.mjs +2 -0
- package/guard-runner.mjs +40 -4
- package/guard-vectors.json +396 -3
- package/package.json +4 -3
- package/protected-parent-iframes.mjs +9 -1
- package/protected.mjs +49 -0
- package/schema/catalog.schema.json +22 -0
- package/schema/guard-vectors.schema.json +22 -0
package/protected.mjs
CHANGED
|
@@ -113,3 +113,52 @@ export function protectedOrigins(rules, extraOrigins = []) {
|
|
|
113
113
|
|
|
114
114
|
return { url, target, cookieDomain, storageKey, unparseable, extensionFrame };
|
|
115
115
|
}
|
|
116
|
+
|
|
117
|
+
export function credentialOrigins(rules) {
|
|
118
|
+
const hosts = (rules?.origins ?? [])
|
|
119
|
+
.map((text) => {
|
|
120
|
+
const u = parse(text);
|
|
121
|
+
return u?.host ? hostOf(u) : null;
|
|
122
|
+
})
|
|
123
|
+
.filter(Boolean);
|
|
124
|
+
|
|
125
|
+
const hostMatch = (text) => {
|
|
126
|
+
const u = parse(text);
|
|
127
|
+
if (!u || !['http', 'https'].includes(scheme(u))) return false;
|
|
128
|
+
const h = hostOf(u);
|
|
129
|
+
return hosts.includes(h);
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
const cookieDomain = (domain) => {
|
|
133
|
+
let d = String(domain ?? '').toLowerCase();
|
|
134
|
+
if (d.startsWith('.')) d = d.slice(1);
|
|
135
|
+
if (d.endsWith('.')) d = d.slice(0, -1);
|
|
136
|
+
if (d === '') return false;
|
|
137
|
+
return hosts.some((h) => under(h, d));
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
const topLevelSite = (text) => {
|
|
141
|
+
const u = parse(text);
|
|
142
|
+
if (!u || !['http', 'https'].includes(scheme(u))) return false;
|
|
143
|
+
const site = hostOf(u);
|
|
144
|
+
return hosts.some((h) => under(h, site));
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
const storageKey = (key) => {
|
|
148
|
+
const [first, ...rest] = String(key ?? '').split('^');
|
|
149
|
+
if (hostMatch(first)) return true;
|
|
150
|
+
return rest
|
|
151
|
+
.filter((p) => p.startsWith('0'))
|
|
152
|
+
.map((p) => p.slice(1))
|
|
153
|
+
.some((text) => topLevelSite(text));
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
return {
|
|
157
|
+
url: hostMatch,
|
|
158
|
+
cookieDomain,
|
|
159
|
+
topLevelSite,
|
|
160
|
+
storageKey,
|
|
161
|
+
hosts: () => [...hosts],
|
|
162
|
+
refusal: () => rules?.refusal ?? '',
|
|
163
|
+
};
|
|
164
|
+
}
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
"discovery",
|
|
14
14
|
"seven",
|
|
15
15
|
"protectedOrigins",
|
|
16
|
+
"credentialOrigins",
|
|
16
17
|
"profiles",
|
|
17
18
|
"launch",
|
|
18
19
|
"platforms"
|
|
@@ -257,6 +258,27 @@
|
|
|
257
258
|
"refusal": { "$ref": "#/$defs/name" }
|
|
258
259
|
}
|
|
259
260
|
},
|
|
261
|
+
"credentialOrigins": {
|
|
262
|
+
"description": "Identity-provider origins whose cookies and web storage are withheld from CDP export and whose cookie/storage writes are refused. Pages on these origins stay drivable. Not used for page protection (judge_url, attach, navigate, redaction hosts). Each entry is an absolute https origin (scheme+host, no path, port, trailing slash, leading dot, or wildcard). Matching: url/securityOrigin by exact entry host with http or https (port ignored); storageKey origin part (before ^) by exact entry host EQUALS; storageKey ^0 site part and partitionKey.topLevelSite by under(entryHost, siteHost); cookie domain by under(entryHost, domain).",
|
|
263
|
+
"type": "object",
|
|
264
|
+
"additionalProperties": false,
|
|
265
|
+
"required": ["origins", "refusal"],
|
|
266
|
+
"properties": {
|
|
267
|
+
"origins": {
|
|
268
|
+
"type": "array",
|
|
269
|
+
"minItems": 1,
|
|
270
|
+
"uniqueItems": true,
|
|
271
|
+
"items": {
|
|
272
|
+
"type": "string",
|
|
273
|
+
"pattern": "^https://[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)+$"
|
|
274
|
+
}
|
|
275
|
+
},
|
|
276
|
+
"refusal": {
|
|
277
|
+
"type": "string",
|
|
278
|
+
"pattern": "^slicc: refused: "
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
},
|
|
260
282
|
"profiles": {
|
|
261
283
|
"type": "object",
|
|
262
284
|
"additionalProperties": false,
|
|
@@ -255,6 +255,8 @@
|
|
|
255
255
|
"vault-x",
|
|
256
256
|
"apex",
|
|
257
257
|
"own",
|
|
258
|
+
"idp",
|
|
259
|
+
"idp-stg",
|
|
258
260
|
"chrome-newtab",
|
|
259
261
|
"chrome-new-tab-page",
|
|
260
262
|
"chrome-settings",
|
|
@@ -388,6 +390,13 @@
|
|
|
388
390
|
"minLength": 1
|
|
389
391
|
}
|
|
390
392
|
},
|
|
393
|
+
"notes": {
|
|
394
|
+
"type": "array",
|
|
395
|
+
"items": {
|
|
396
|
+
"type": "string",
|
|
397
|
+
"minLength": 1
|
|
398
|
+
}
|
|
399
|
+
},
|
|
391
400
|
"observable": {
|
|
392
401
|
"type": "object",
|
|
393
402
|
"additionalProperties": false,
|
|
@@ -596,6 +605,19 @@
|
|
|
596
605
|
}
|
|
597
606
|
}
|
|
598
607
|
},
|
|
608
|
+
{
|
|
609
|
+
"type": "object",
|
|
610
|
+
"additionalProperties": false,
|
|
611
|
+
"required": ["credentialExport", "as"],
|
|
612
|
+
"properties": {
|
|
613
|
+
"credentialExport": {
|
|
614
|
+
"const": true
|
|
615
|
+
},
|
|
616
|
+
"as": {
|
|
617
|
+
"$ref": "#/$defs/name"
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
},
|
|
599
621
|
{
|
|
600
622
|
"type": "object",
|
|
601
623
|
"additionalProperties": false,
|