fix(javascript): preserve loader authority for exact suffixes (#9477)

* fix(javascript): require exact loader suffix case

* fix(javascript): share exact loader mode across import resolution

* test(process): align symlink fixture with filesystem checkpoints

* test(javascript): normalize the module resolution oracle path separators

* test(frida): assert the CLI spawn Evidence contract

* test(mcp): use an unsupported analysis-view parent

* test(browser): separate source-location line bounds from parity

* fix(javascript): preserve uncertain loader provenance

* test(javascript): cover uncertain require resolution

* fix(javascript): retain conditional Electron evidence

* fix(javascript): preserve timed semantic provenance

* fix(javascript): retain conditional builtin effects

* test(javascript): distinguish bundled host authority

* fix(javascript): preserve nested loader invocation identity

* test(javascript): qualify Electron fixture authority

* fix(javascript): preserve loader invocation authority

* fix(javascript): respect source order for resolver escapes

* fix(javascript): check nested loader callable mutations

* fix(javascript): retain conditional constructor requests

* fix(reference): retain constructor loader relationships

* fix(reference): follow nested loader callable paths

* refactor(javascript): share callable mutation interpretation

* fix(javascript): require exact package loader suffixes

* refactor(javascript): unify conditional relation evidence

* refactor(javascript): unify conditional node evidence

* fix(javascript): retain unknown authority for mixed case sources

* fix(javascript): preserve loader uncertainty for dotfiles

* fix(reference): classify javascript suffix dotfiles

* test(reference): cover suffix dotfiles through cli

* fix(javascript): retain equivalent conditional built-in origins

* fix(javascript): preserve wrapped resolver operation

* fix(javascript): retain nested conditional built-in receivers

* test(javascript): declare CommonJS in native addon fixtures

* fix(javascript): retain wrapped resolver candidates

* style: format merged native command schema

* fix(javascript): preserve uncertain loader authority

* test(javascript): require candidate preload evidence

* test(javascript): cover reference loader member writes

---------

Co-authored-by: ShuaixinHuang <1836656514@qq.com>
This commit is contained in:
morlutoandShuaixinHuang authored and GitHub committed 2026-11-09 13:21:24 +08:00
1 parent 78a84d75c0
commit b46f4fcebd
112 files changed
+5156 -797

No files matched your search

@@ -12,10 +12,7 @@ import {
type JavaScriptArtifactGraphContext,
type JavaScriptArtifactGraphCoverage,
} from "./JavaScriptArtifactGraphContext.js";
import {
astObservationEvidence,
staticInferenceEvidence,
} from "./JavaScriptArtifactGraphEvidence.js";
import { staticInferenceEvidence } from "./JavaScriptArtifactGraphEvidence.js";
import type {
ElectronIpcContext,
ElectronIpcRecord,
@@ -23,6 +20,8 @@ import type {
import {
addElectronAstEdge,
addElectronInferenceEdge,
ELECTRON_CANDIDATE_LIMITATION,
electronFindingEvidence,
electronFindingSourceNode,
electronObservationIdentity,
} from "./ElectronBoundaryGraphContext.js";
@@ -111,6 +110,7 @@ const addIpcRecord = (
coverage,
relation: record.finding.mode === "invoke" ? "invokes" : "sends",
operation: "map-ipc-transmission",
loaderAuthority: record.finding.loader_authority,
properties: {
side: record.finding.side,
operation: record.finding.operation,
@@ -150,10 +150,13 @@ const addChannelNode = (
return context.accumulator.addNode({
kind: "ipc-channel",
identity:
finding.resolution_basis === "wrapper-substitution"
finding.resolution_basis === "wrapper-substitution" ||
finding.loader_authority === "candidate"
? artifactLocalIdentity(
file.sha256,
"electron-inferred-ipc-channel",
finding.loader_authority === "candidate"
? "electron-candidate-ipc-channel"
: "electron-inferred-ipc-channel",
identityKey,
)
: electronObservationIdentity(
@@ -174,36 +177,67 @@ const addChannelNode = (
channel: finding.channel,
channel_expression: finding.channel_expression,
resolution: finding.channel === null ? "dynamic" : "literal",
...(finding.loader_authority === "candidate"
? { loader_authority: "candidate" }
: {}),
...(finding.invocation_location === undefined
? {}
: { invocation_location: finding.invocation_location }),
},
evidence: (finding.resolution_basis === "wrapper-substitution"
? staticInferenceEvidence
: astObservationEvidence)({
sha256: file.sha256,
path: file.path,
range: finding.location,
operation: "observe-ipc-channel-expression",
coverage,
limitations: [
...(finding.receiver === undefined
? []
: [
"The receiver is a source-level allocation, not a runtime frame identity; registration and dispatch remain unverified.",
]),
...(finding.resolution_basis !== "wrapper-substitution"
? []
: [
"The channel is inferred through lexical wrapper substitution; runtime registration and dispatch remain unverified.",
]),
...(finding.channel !== null
? []
: [
"The channel expression is dynamic; its runtime value and pairings remain unknown.",
]),
],
}),
evidence:
finding.resolution_basis !== "wrapper-substitution"
? electronFindingEvidence(
{
sha256: file.sha256,
path: file.path,
range: finding.location,
operation: "observe-ipc-channel-expression",
coverage,
limitations: [
...(finding.receiver === undefined
? []
: [
"The receiver is a source-level allocation, not a runtime frame identity; registration and dispatch remain unverified.",
]),
...(finding.channel !== null
? []
: [
"The channel expression is dynamic; its runtime value and pairings remain unknown.",
]),
],
},
finding.loader_authority,
)
: staticInferenceEvidence({
sha256: file.sha256,
path: file.path,
range: finding.location,
operation: "observe-ipc-channel-expression",
coverage,
...(finding.loader_authority === "candidate"
? { confidence: "low" as const }
: {}),
limitations: [
...(finding.loader_authority === "candidate"
? [ELECTRON_CANDIDATE_LIMITATION]
: []),
...(finding.receiver === undefined
? []
: [
"The receiver is a source-level allocation, not a runtime frame identity; registration and dispatch remain unverified.",
]),
...(finding.resolution_basis !== "wrapper-substitution"
? []
: [
"The channel is inferred through lexical wrapper substitution; runtime registration and dispatch remain unverified.",
]),
...(finding.channel !== null
? []
: [
"The channel expression is dynamic; its runtime value and pairings remain unknown.",
]),
],
}),
},
],
});
@@ -245,19 +279,38 @@ const addHandlerNode = (input: IpcHandlerInput): ApplicationNode => {
channel_expression: finding.channel_expression,
handler_kind: finding.handler_kind,
handler_location: finding.handler_location,
...(finding.loader_authority === "candidate"
? { loader_authority: "candidate" }
: {}),
...(finding.invocation_location === undefined
? {}
: { invocation_location: finding.invocation_location }),
},
evidence: (finding.resolution_basis === "wrapper-substitution"
? staticInferenceEvidence
: astObservationEvidence)({
sha256: file.sha256,
path: file.path,
range: handlerRange,
operation: "observe-ipc-handler",
coverage,
}),
evidence:
finding.resolution_basis !== "wrapper-substitution"
? electronFindingEvidence(
{
sha256: file.sha256,
path: file.path,
range: handlerRange,
operation: "observe-ipc-handler",
coverage,
},
finding.loader_authority,
)
: staticInferenceEvidence({
sha256: file.sha256,
path: file.path,
range: handlerRange,
operation: "observe-ipc-handler",
coverage,
...(finding.loader_authority === "candidate"
? {
confidence: "low" as const,
limitations: [ELECTRON_CANDIDATE_LIMITATION],
}
: {}),
}),
},
],
});
@@ -270,6 +323,7 @@ const addHandlerNode = (input: IpcHandlerInput): ApplicationNode => {
relation: "contains",
operation: "locate-ipc-handler",
properties: { side: finding.side, operation: finding.operation },
loaderAuthority: finding.loader_authority,
});
addElectronInferenceEdge(context, {
source: handler,
@@ -279,6 +333,7 @@ const addHandlerNode = (input: IpcHandlerInput): ApplicationNode => {
coverage,
relation: "handles",
operation: "map-ipc-handler-registration",
loaderAuthority: finding.loader_authority,
properties: {
channel: finding.channel,
channel_expression: finding.channel_expression,
@@ -362,17 +417,23 @@ const addValidationObservation = (input: ValidationObservationInput): void => {
mechanism: validation.mechanism,
expected: validation.expected,
enforcement: validation.enforcement,
...(validation.loader_authority === "candidate"
? { loader_authority: "candidate" }
: {}),
},
evidence: astObservationEvidence({
sha256: file.sha256,
path: file.path,
range: validation.location,
operation: "observe-ipc-sender-validation-candidate",
coverage,
limitations: [
"A comparison or string check is visible, but static syntax alone does not prove rejection, ordering, or complete sender validation.",
],
}),
evidence: electronFindingEvidence(
{
sha256: file.sha256,
path: file.path,
range: validation.location,
operation: "observe-ipc-sender-validation-candidate",
coverage,
limitations: [
"A comparison or string check is visible, but static syntax alone does not prove rejection, ordering, or complete sender validation.",
],
},
validation.loader_authority,
),
},
],
});