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

@@ -63,6 +63,7 @@ const ipcEndpointKey = (value: ElectronIpcFinding): string =>
value.side,
value.operation,
value.channel,
value.loader_authority ?? "proven",
javascriptSourceRangeKey(value.location),
]);
@@ -205,7 +206,12 @@ interface BridgeExposure {
}
const bridgeExposureKey = (value: ElectronContextBridgeFinding): string =>
JSON.stringify([value.world, value.api_key, value.api_key_expression]);
JSON.stringify([
value.world,
value.api_key,
value.api_key_expression,
value.loader_authority ?? "proven",
]);
const bridgeContributionKey = (value: ElectronContextBridgeFinding): string =>
JSON.stringify([value.world_id, value.members, value.unknown_members]);
@@ -234,6 +240,7 @@ const mergeBridgeExposures = (
});
interface PathContext {
readonly loader_authority?: "candidate";
readonly entryNode: t.Node;
/** Source ranges of the local calls this path made since its entry. */
readonly calls: string[];
@@ -423,11 +430,15 @@ export function* collectElectronWrappedCallPathsSteps(
accumulator.unknownFindings += 1;
return null;
}
const authorityContext =
value.kind === "external" && value.loaderAuthority === "candidate"
? { ...context, loader_authority: "candidate" as const }
: context;
return (
value.conditions?.reduce(
(current, branch) => condition(current, branch.node, branch.positive),
context,
) ?? context
authorityContext,
) ?? authorityContext
);
};
// Duplicate checks consult only facts at the same endpoint and call site.
@@ -873,6 +884,9 @@ export function* collectElectronWrappedCallPathsSteps(
): void => {
if (context.entryKind === null) return;
const path: ElectronCallPath = {
...(context.loader_authority === "candidate"
? { loader_authority: "candidate" as const }
: {}),
entry_kind: context.entryKind,
entry: context.entry,
...(context.entryKind !== "bridge-member" ||
@@ -958,6 +972,9 @@ export function* collectElectronWrappedCallPathsSteps(
? undefined
: range(context.entryNode);
const findingContext = {
...(context.loader_authority === "candidate"
? { loader_authority: "candidate" as const }
: {}),
module_key: null,
location,
...(invocationLocation === undefined
@@ -1223,6 +1240,9 @@ export function* collectElectronWrappedCallPathsSteps(
// call contributes a separate API per key it is invoked with.
const inventory = bridgeMemberInventory(object);
const finding: ElectronContextBridgeFinding = {
...(context.loader_authority === "candidate"
? { loader_authority: "candidate" as const }
: {}),
world: exposure.world,
world_id: worldId,
api_key: key.value,