diff --git a/src/config/environment.ts b/src/config/environment.ts index fbc771dbea..672f77709b 100644 --- a/src/config/environment.ts +++ b/src/config/environment.ts @@ -236,7 +236,13 @@ export const parseEnvironment = ( "REA_GHIDRA_SEED_FILE", "REA_GHIDRA_DISABLED_ANALYZERS", "REA_GHIDRA_NATIVEAOT_JAR", - ].filter((setting) => environment[setting] !== undefined); + ].filter( + (setting) => + // Blank analyzer lists parse to no override, so they cannot conflict. + (setting === "REA_GHIDRA_DISABLED_ANALYZERS" + ? env[setting] + : environment[setting]) !== undefined, + ); if (incompatible.length > 0) return err( new ConfigurationError("Invalid existing Ghidra project configuration", { diff --git a/tests/boundary/providers/ghidra/ghidraProjectSnapshot.test.ts b/tests/boundary/providers/ghidra/ghidraProjectSnapshot.test.ts index d429cbf689..1f1e0a0033 100644 --- a/tests/boundary/providers/ghidra/ghidraProjectSnapshot.test.ts +++ b/tests/boundary/providers/ghidra/ghidraProjectSnapshot.test.ts @@ -114,6 +114,22 @@ it("parses an opt-in project once for shared CLI/MCP configuration and rejects i ); }); +it("accepts a blank analyzer override beside an existing project and rejects a named one", () => { + const environment = { + REA_GHIDRA_PROJECT_PATH: join(process.cwd(), "existing.gpr"), + }; + for (const blank of ["", " ", ", ,"]) + expect( + parseConfig({ ...environment, REA_GHIDRA_DISABLED_ANALYZERS: blank }).ok, + ).toBe(true); + expect( + parseConfig({ + ...environment, + REA_GHIDRA_DISABLED_ANALYZERS: "Decompiler Parameter ID", + }).ok, + ).toBe(false); +}); + it("reports an invalid derived program name at its selection boundary", async () => { const { source } = await fixture(); await expect(