mirror of
https://github.com/morluto/rea.git
synced 2026-11-29 01:46:39 +00:00
fix(rizin): state that the version banner, too, precedes the command
a2fc5a11f qualified only the executable's SHA-256 as a pre-launch
observation. The -v banner, and so the recorded tool and version, is
also read before the command runs, so a package update in between
attributes the command's output to the old version. The limitation,
renamed EXECUTABLE_OBSERVATION_TIMING, now says the SHA-256 and any -v
banner were read before the command launched and do not prove the bytes
or the version that ran; the documentation says so too.
This commit is contained in:
1 parent
cba109f963
commit
85eb3b6c08
3 files changed
+21
-13
No files matched your search
@@ -101,8 +101,9 @@ marked by `provider_version_banner_truncated`; a cut banner identifies no tool,
|
||||
since the cut could fall inside its version. The budget and the recorded banner
|
||||
cover the line as printed, surrounding whitespace included; only identification
|
||||
ignores that whitespace. These describe the file at that path when
|
||||
REA checked it; they cannot prove the exact bytes executed if the file changes
|
||||
before the launch, and Evidence that records the SHA-256 says so in a limitation.
|
||||
REA checked it; they cannot prove the exact bytes or version executed if the
|
||||
file changes before the launch, and Evidence that records them says so in a
|
||||
limitation.
|
||||
A different tool that accepts the same arguments, such as
|
||||
radare2, still runs: its Evidence names that tool and adds a limitation. A probe
|
||||
that fails, times out, prints output that is not valid UTF-8 or prints an
|
||||
|
||||
@@ -904,7 +904,7 @@ export class ReverseEngineeringService {
|
||||
`The executable version and supported formats are reported as unknown because ${reason}.`,
|
||||
...(observed?.provider_executable_sha256 === undefined
|
||||
? []
|
||||
: [EXECUTABLE_DIGEST_TIMING]),
|
||||
: [EXECUTABLE_OBSERVATION_TIMING]),
|
||||
...(probe === undefined ? [] : [probe.assumedIdentity]),
|
||||
],
|
||||
parameters:
|
||||
@@ -1026,7 +1026,7 @@ export class ReverseEngineeringService {
|
||||
identity: identification.identity,
|
||||
limitations: [
|
||||
`The executable version comes from ${banner}; supported formats remain unknown.`,
|
||||
EXECUTABLE_DIGEST_TIMING,
|
||||
EXECUTABLE_OBSERVATION_TIMING,
|
||||
...identification.limitations,
|
||||
],
|
||||
parameters: { ...bannerParameters, provider_identity: "banner" },
|
||||
@@ -1178,9 +1178,9 @@ type VersionProbeOutcome =
|
||||
};
|
||||
|
||||
/** Why a probe that read no usable banner leaves the version unknown. */
|
||||
/** A digest read before launch cannot bind the bytes that ran. */
|
||||
export const EXECUTABLE_DIGEST_TIMING =
|
||||
"The executable's SHA-256 was read before the probe and the command launched, so it does not prove the bytes that ran.";
|
||||
/** Observations read before the command cannot bind the tool that ran. */
|
||||
export const EXECUTABLE_OBSERVATION_TIMING =
|
||||
"The executable's SHA-256, and any -v banner, were read before the command launched, so they do not prove the bytes or the version that ran.";
|
||||
|
||||
export const VERSION_PROBE_FAILURE_REASONS = {
|
||||
failed: "did not complete successfully",
|
||||
|
||||
@@ -6,7 +6,7 @@ import { expect, expectTypeOf, it, vi } from "vitest";
|
||||
|
||||
import {
|
||||
digestFile,
|
||||
EXECUTABLE_DIGEST_TIMING,
|
||||
EXECUTABLE_OBSERVATION_TIMING,
|
||||
type ReverseEngineeringProcesses,
|
||||
VERSION_PROBE_FAILURE_REASONS,
|
||||
} from "../../../src/application/reverse/ReverseEngineeringService.js";
|
||||
@@ -91,8 +91,13 @@ posix(
|
||||
provider_version_banner_truncated: false,
|
||||
provider_identity: "banner",
|
||||
});
|
||||
// The digest precedes both launches, which Evidence states.
|
||||
expect(result.value.limitations).toContain(EXECUTABLE_DIGEST_TIMING);
|
||||
// The digest and banner precede the command, which Evidence states.
|
||||
expect(result.value.limitations).toContain(EXECUTABLE_OBSERVATION_TIMING);
|
||||
expect(result.value.limitations).toContainEqual(
|
||||
expect.stringMatching(
|
||||
/SHA-256, and any -v banner, were read before the command launched/u,
|
||||
),
|
||||
);
|
||||
}
|
||||
// Each call probes, then runs its command, both from the resolved path
|
||||
// and within the call's budget.
|
||||
@@ -287,7 +292,7 @@ posix(
|
||||
expect(result.value.parameters).not.toHaveProperty(
|
||||
"provider_version_banner",
|
||||
);
|
||||
expect(result.value.limitations).toContain(EXECUTABLE_DIGEST_TIMING);
|
||||
expect(result.value.limitations).toContain(EXECUTABLE_OBSERVATION_TIMING);
|
||||
expect(result.value.raw_result).toMatchObject({
|
||||
stdout: "command output",
|
||||
});
|
||||
@@ -737,8 +742,10 @@ posix(
|
||||
expect(result.value.limitations).toContain(
|
||||
"The executable version and supported formats are reported as unknown because the executable could not be read (EACCES).",
|
||||
);
|
||||
// Without a digest there is no digest timing to qualify.
|
||||
expect(result.value.limitations).not.toContain(EXECUTABLE_DIGEST_TIMING);
|
||||
// Without a digest or banner there is no timing to qualify.
|
||||
expect(result.value.limitations).not.toContain(
|
||||
EXECUTABLE_OBSERVATION_TIMING,
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
Reference in new issue
Block a user