Lines 216-256javascript
216 if (text.length === 0 || text.length > maxTextLength)
218 const idClassMatch = idClassPattern.test(`${el.id} ${el.className}`);
219 const textMatch = textPatterns.some((pattern) => pattern.test(text));
220 if (!(idClassMatch && textMatch))
222 const style = window.getComputedStyle(el);
223 const isOverlayish = style.position === "fixed" || style.position === "sticky" || Number(style.zIndex || "0") >= 100;
225 el.style.setProperty("display", "none", "important");
232// ---- C1/C2: SSRFガード付きナビゲーション ----
233const NAVIGATION_ROUTE_PATTERN = "**/*";
235 * サブリソース/サブフレームのリクエストURLをSSRF検証する。
237 * data:/blob:/about: 等ネットワークアクセスを伴わないスキーム(インライン画像・CSS等)は許可し、
238 * file: はローカルファイル読み取り防止のため遮断、http(s)は埋め込みIPが予約アドレスでないか検証する。
HighCloud Metadata Access
Source reaches cloud instance metadata or link-local credential endpoints.
dist/fetcher/browser.jsView on unpkg · L236 239 * 同一ホストへの繰り返し(ページ自身のホストやCDN等)でDNS解決を重複させないよう、
240 * 1回のナビゲーション内はホスト単位で検証結果(Promise)を使い回す。
242function guardRequestUrl(rawUrl, hostGuardCache) {
245 parsed = new URL(rawUrl);
248 return Promise.reject(new InvalidUrlError(rawUrl, "リクエストURLの形式が不正です"));
250 if (parsed.protocol !== "http:" && parsed.protocol !== "https:") {
251 if (parsed.protocol === "file:") {
252 return Promise.reject(new InvalidUrlError(rawUrl, "サブリソースのfile:スキームは許可されません"));
254 return Promise.resolve();
256 const key = `${parsed.protocol}//${parsed.host}`;