Skip to content

OpenAI's Codex Security CLI and TypeScript SDK for finding, validating, and fixing security vulnerabilities. npm: https://www.npmjs.com/package/@openai/codex-security

fix(config): reject owned plugin keys inside Codex profiles (#861)

kevina753544761d5
diff --git a/sdk/typescript/src/config.ts b/sdk/typescript/src/config.ts
index b198a9b22..5fc86494e 100644
--- a/sdk/typescript/src/config.ts
+++ b/sdk/typescript/src/config.ts
@@ -322,6 +322,11 @@ function validateOverrides(overrides: JsonObject): void {
`Codex override profile ${name} must be a TOML table.`,
);
}
+ if ("plugins" in profile || "marketplaces" in profile) {
+ throw new ConfigurationError(
+ `Codex Security owns plugin loading configuration in profile ${name}.`,
+ );
+ }
const profileFeatures = profile["features"];
if (profileFeatures !== undefined && !isObject(profileFeatures)) {
throw new ConfigurationError(
diff --git a/sdk/typescript/tests-ts/config.test.ts b/sdk/typescript/tests-ts/config.test.ts
index 3c95f5a19..b5d374bd2 100644
--- a/sdk/typescript/tests-ts/config.test.ts
+++ b/sdk/typescript/tests-ts/config.test.ts
@@ -748,6 +748,16 @@ describe("Codex configuration", () => {
},
}),
).rejects.toThrow("owns plugin loading configuration");
+ for (const owned of ["plugins", "marketplaces"] as const) {
+ await expect(
+ mergedCodexConfig({
+ codexOverrides: {
+ profile: "disabled",
+ profiles: { disabled: { [owned]: {} } },
+ },
+ }),
+ ).rejects.toThrow("owns plugin loading configuration");
+ }
await expect(
mergedCodexConfig({
codexOverrides: {