@acepaste/ingress 0.9.21 → 0.9.23
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/dist/src/classifier-model.d.ts +19 -18
- package/dist/src/classifier-model.js +1 -1
- package/dist/src/engine.d.ts +2 -1
- package/dist/src/engine.js +1 -1
- package/dist/src/image.d.ts +6 -0
- package/dist/src/image.js +6 -0
- package/dist/src/types.d.ts +3 -3
- package/dist/src/types.js +2 -2
- package/package.json +1 -1
package/dist/src/engine.d.ts
CHANGED
|
@@ -92,7 +92,8 @@ export declare class IngressEngine {
|
|
|
92
92
|
scanImage(bytes: Uint8Array, opts?: IngressOptions & {
|
|
93
93
|
url?: string;
|
|
94
94
|
source?: SourceInfo; /** words shown beside the image: a caption, alt text, a file name */
|
|
95
|
-
caption?: string; /**
|
|
95
|
+
caption?: string; /** for a screenshot: the text the page's own source says is on it (see image.ts) */
|
|
96
|
+
sourceText?: string; /** how to read the pixels (default: the vision helper when built); false reads the container only */
|
|
96
97
|
vision?: VisionRunner | false;
|
|
97
98
|
}): Promise<IngressResult>;
|
|
98
99
|
/**
|
package/dist/src/engine.js
CHANGED
|
@@ -214,7 +214,7 @@ export class IngressEngine {
|
|
|
214
214
|
return this.analyze({ url, finalUrl: url, redirectChain: [], raw: text, kind: "html", externalRules: [], timings: {}, t0, override: !!opts.override, extraFindings: extra, rule, source: opts.source });
|
|
215
215
|
}
|
|
216
216
|
const ti = performance.now();
|
|
217
|
-
const insp = await inspectImage(bytes, { vision: opts.vision, caption: opts.caption });
|
|
217
|
+
const insp = await inspectImage(bytes, { vision: opts.vision, caption: opts.caption, sourceText: opts.sourceText });
|
|
218
218
|
return this.analyze({ url, finalUrl: url, redirectChain: [], raw: insp.report, kind: "image", externalRules: [], timings: { visibility: performance.now() - ti }, t0, override: !!opts.override, extraFindings: insp.findings, rule, source: opts.source, adapted: { segments: insp.segments, findings: [] }, imageCoverage: insp.coverage });
|
|
219
219
|
});
|
|
220
220
|
}
|
package/dist/src/image.d.ts
CHANGED
|
@@ -100,5 +100,11 @@ export interface InspectOptions {
|
|
|
100
100
|
vision?: VisionRunner | false;
|
|
101
101
|
/** the words shown beside the image (a caption, alt text, a file name), for comparison with what it holds */
|
|
102
102
|
caption?: string;
|
|
103
|
+
/**
|
|
104
|
+
* For a screenshot of a page or an app: the text that page's own source says is on it (its visible DOM text,
|
|
105
|
+
* its accessibility tree). Words on the screen that the source does not have were drawn there some other way:
|
|
106
|
+
* an image, a canvas, an overlay. That is how a fake dialog or a fake message is painted into a real window.
|
|
107
|
+
*/
|
|
108
|
+
sourceText?: string;
|
|
103
109
|
}
|
|
104
110
|
export declare function inspectImage(bytes: Uint8Array, opts?: InspectOptions): Promise<ImageInspection>;
|
package/dist/src/image.js
CHANGED
|
@@ -27,6 +27,7 @@ import { stateDir } from "./changes.js";
|
|
|
27
27
|
import { readImageMeta } from "./image-meta.js";
|
|
28
28
|
import { judgeQrPayload } from "./qr.js";
|
|
29
29
|
import { hostsMentioned } from "./egress.js";
|
|
30
|
+
import { passagesOnlyIn } from "./served.js";
|
|
30
31
|
// ---------- comparing readings ----------
|
|
31
32
|
const norm = (s) => s.toLowerCase().normalize("NFKD").replace(/[^\p{L}\p{N}]+/gu, " ").trim();
|
|
32
33
|
function trigrams(s) {
|
|
@@ -284,6 +285,11 @@ export async function inspectImage(bytes, opts = {}) {
|
|
|
284
285
|
const flat = shown.replace(/\s+/g, " ");
|
|
285
286
|
if (CLICKFIX_OPEN.test(flat) && CLICKFIX_PASTE.test(flat))
|
|
286
287
|
add({ kind: "image.clickfix", confidence: 0.55, severity: 0.75, message: "the picture tells its reader to open a terminal or the Run box and paste something: a fake verification or fix screen (ClickFix). Nothing on a screen is a reason to run a command", location: "image/text" });
|
|
288
|
+
if (opts.sourceText && opts.sourceText.trim().split(/\s+/).length >= 20) {
|
|
289
|
+
const painted = passagesOnlyIn(flat, opts.sourceText, 8);
|
|
290
|
+
if (painted.length)
|
|
291
|
+
add({ kind: "image.screen_not_in_source", confidence: 0.35, severity: 0.6, message: `${painted.length} passage(s) on this screen are not in the page's own text: they were drawn there (an image, a canvas, an overlay), which is how a fake dialog or message is painted into a real window`, excerpt: painted[0].slice(0, 160), location: "image/text" });
|
|
292
|
+
}
|
|
287
293
|
const resized = resizedOnly(vision);
|
|
288
294
|
if (resized.lines.length) {
|
|
289
295
|
segments.push({ text: resized.lines.join("\n"), visibility: "concealed", path: "image/only-when-resized" });
|
package/dist/src/types.d.ts
CHANGED
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
* at the same source would not see is suspect by default.
|
|
6
6
|
*/
|
|
7
7
|
import type { NetPolicy } from "./netpolicy.js";
|
|
8
|
-
export declare const ENGINE_VERSION = "0.9.
|
|
8
|
+
export declare const ENGINE_VERSION = "0.9.23";
|
|
9
9
|
/** bump whenever a detector's behavior changes; receipts carry it so verdicts are reproducible */
|
|
10
|
-
export declare const RULESET_VERSION = "2026.11.
|
|
10
|
+
export declare const RULESET_VERSION = "2026.11.19-1";
|
|
11
11
|
/**
|
|
12
12
|
* clean: delivered. suspect: refused, overridable. hostile: refused, not overridable.
|
|
13
13
|
* unreachable: nothing could be fetched or read (network error, timeout, redirect loop,
|
|
@@ -50,7 +50,7 @@ export declare function parseScanHints(o: {
|
|
|
50
50
|
/** multiplier on the suspect threshold per trust level: strangers and broadcasts need less evidence */
|
|
51
51
|
export declare const TRUST_SUSPECT_FACTOR: Record<TrustLevel, number>;
|
|
52
52
|
export type PassName = "acquire" | "policy" | "visibility" | "character" | "script" | "supplychain" | "secrets" | "meaning" | "cloaking" | "sandbox" | "code" | "channel" | "classifier" | "plugin";
|
|
53
|
-
export type FindingKind = "policy.denied_source" | "policy.redirect_chain" | "acquire.unreachable" | "acquire.cloaking_check_incomplete" | "acquire.ai_agent_refused" | "unicode.tag_characters" | "unicode.zero_width" | "unicode.bidi_control" | "unicode.variation_selector_smuggling" | "unicode.mixed_script_confusable" | "unicode.fullwidth_or_math_lookalike" | "unicode.combining_flood" | "unicode.encoded_payload" | "unicode.entity_smuggling" | "unicode.whitespace_channel" | "visibility.css_hidden" | "visibility.offscreen" | "visibility.attribute_only" | "visibility.html_comment" | "visibility.tiny_or_transparent" | "visibility.markdown_hidden" | "visibility.terminal_hidden" | "visibility.terminal_control" | "email.part_divergence" | "email.sender_mismatch" | "email.authentication_failed" | "email.remote_content" | "email.uninspected_part" | "calendar.alarm_action" | "calendar.description_divergence" | "message.text_divergence" | "message.sender_impersonation" | "message.scam_shape" | "message.verification_code" | "message.uninspected_part" | "notification.source_mismatch" | "nearby.authority_name" | "nearby.lookalike" | "nearby.link" | "nearby.oversized_field" | "automation.private_outside_send" | "automation.runs_code" | "automation.destination" | "automation.unreadable" | "image.clickfix" | "captions.hidden_cue" | "captions.unreadable_cue" | "captions.not_spoken" | "captions.addressed_to_notetaker" | "captions.spoken_approval" | "audio.quiet_speech" | "audio.transcript_unstable" | "audio.metadata_text" | "audio.not_transcribed" | "image.text_only_when_resized" | "image.low_contrast_text" | "image.transparency_text" | "image.later_frame_text" | "image.metadata_text" | "image.trailing_data" | "image.active_content" | "image.code_payload" | "image.code_action" | "image.caption_mismatch" | "image.pixels_not_inspected" | "classifier.injection_likely" | "script.obfuscation" | "script.runtime_codegen" | "script.automation_detection" | "script.post_load_text_injection" | "script.exfil_beacon" | "script.binary_decoding" | "supplychain.lifecycle_script" | "supplychain.url_dependency" | "supplychain.offregistry_resolution" | "supplychain.install_instruction" | "secrets.credential_in_content" | "sandbox.text_injected_after_load" | "sandbox.webdriver_keyed_divergence" | "sandbox.computed_hidden_text" | "sandbox.blocked_egress_attempt" | "meaning.instruction_shaped" | "meaning.role_token" | "meaning.system_prompt_imitation" | "meaning.tool_call_shaped" | "meaning.exfil_markdown_image" | "meaning.exfil_link" | "meaning.adversarial_suffix" | "cloaking.agent_targeted_divergence" | "code.download_execute" | "code.encoded_execution" | "code.reverse_shell" | "code.secret_exfiltration" | "code.persistence" | `plugin.${string}`;
|
|
53
|
+
export type FindingKind = "policy.denied_source" | "policy.redirect_chain" | "acquire.unreachable" | "acquire.cloaking_check_incomplete" | "acquire.ai_agent_refused" | "unicode.tag_characters" | "unicode.zero_width" | "unicode.bidi_control" | "unicode.variation_selector_smuggling" | "unicode.mixed_script_confusable" | "unicode.fullwidth_or_math_lookalike" | "unicode.combining_flood" | "unicode.encoded_payload" | "unicode.entity_smuggling" | "unicode.whitespace_channel" | "visibility.css_hidden" | "visibility.offscreen" | "visibility.attribute_only" | "visibility.html_comment" | "visibility.tiny_or_transparent" | "visibility.markdown_hidden" | "visibility.terminal_hidden" | "visibility.terminal_control" | "email.part_divergence" | "email.sender_mismatch" | "email.authentication_failed" | "email.remote_content" | "email.uninspected_part" | "calendar.alarm_action" | "calendar.description_divergence" | "message.text_divergence" | "message.sender_impersonation" | "message.scam_shape" | "message.verification_code" | "message.uninspected_part" | "notification.source_mismatch" | "nearby.authority_name" | "nearby.lookalike" | "nearby.link" | "nearby.oversized_field" | "automation.private_outside_send" | "automation.runs_code" | "automation.destination" | "automation.unreadable" | "image.clickfix" | "image.screen_not_in_source" | "captions.hidden_cue" | "captions.unreadable_cue" | "captions.not_spoken" | "captions.addressed_to_notetaker" | "captions.spoken_approval" | "audio.quiet_speech" | "audio.transcript_unstable" | "audio.metadata_text" | "audio.not_transcribed" | "image.text_only_when_resized" | "image.low_contrast_text" | "image.transparency_text" | "image.later_frame_text" | "image.metadata_text" | "image.trailing_data" | "image.active_content" | "image.code_payload" | "image.code_action" | "image.caption_mismatch" | "image.pixels_not_inspected" | "classifier.injection_likely" | "script.obfuscation" | "script.runtime_codegen" | "script.automation_detection" | "script.post_load_text_injection" | "script.exfil_beacon" | "script.binary_decoding" | "supplychain.lifecycle_script" | "supplychain.url_dependency" | "supplychain.offregistry_resolution" | "supplychain.install_instruction" | "secrets.credential_in_content" | "sandbox.text_injected_after_load" | "sandbox.webdriver_keyed_divergence" | "sandbox.computed_hidden_text" | "sandbox.blocked_egress_attempt" | "meaning.instruction_shaped" | "meaning.role_token" | "meaning.system_prompt_imitation" | "meaning.tool_call_shaped" | "meaning.exfil_markdown_image" | "meaning.exfil_link" | "meaning.adversarial_suffix" | "cloaking.agent_targeted_divergence" | "code.download_execute" | "code.encoded_execution" | "code.reverse_shell" | "code.secret_exfiltration" | "code.persistence" | `plugin.${string}`;
|
|
54
54
|
export interface Finding {
|
|
55
55
|
pass: PassName;
|
|
56
56
|
kind: FindingKind;
|
package/dist/src/types.js
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
* Governing principle: anything the model would receive that a human looking
|
|
5
5
|
* at the same source would not see is suspect by default.
|
|
6
6
|
*/
|
|
7
|
-
export const ENGINE_VERSION = "0.9.
|
|
7
|
+
export const ENGINE_VERSION = "0.9.23";
|
|
8
8
|
/** bump whenever a detector's behavior changes; receipts carry it so verdicts are reproducible */
|
|
9
|
-
export const RULESET_VERSION = "2026.11.
|
|
9
|
+
export const RULESET_VERSION = "2026.11.19-1";
|
|
10
10
|
export const CONTENT_KINDS = ["html", "markdown", "json", "text", "javascript", "log", "email", "calendar", "message", "notification", "nearby", "automation", "captions", "image", "audio"];
|
|
11
11
|
/** Read a content kind and source from untyped input (an HTTP body, tool arguments). Unknown values are dropped, never guessed. */
|
|
12
12
|
export function parseScanHints(o) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@acepaste/ingress",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.23",
|
|
4
4
|
"description": "AcePaste Ingress engine: acquire, visibility, character, script, supply-chain, sandbox, meaning, verdict, envelope, receipts.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/src/index.js",
|