Skip to content

Commit b56bc02

Browse files
rsazcursoragent
andcommitted
fix(security): resolve js-yaml advisory and clear-text env logging
Pin transitive js-yaml to 4.2.0 via npm overrides (dev toolchain only). Replace debug dump of the full env object with key names only. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent a6a9d22 commit b56bc02

4 files changed

Lines changed: 5 additions & 50 deletions

File tree

package-lock.json

Lines changed: 0 additions & 48 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@
8383
"optional": true
8484
}
8585
},
86+
"overrides": {
87+
"js-yaml": "4.2.0"
88+
},
8689
"devDependencies": {
8790
"@commitlint/cli": "19.6.0",
8891
"@commitlint/config-conventional": "19.6.0",

src/env/environment.early.spec/populate.early.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ describe("populate() populate method", () => {
7272
populate(mockEnvObject, mockParsed, mockOptions as any);
7373

7474
expect(log).toHaveBeenCalledWith('"KEY1" was set to "value1"', LogLevel.Debug);
75+
expect(log).toHaveBeenCalledWith("Loaded env keys: KEY1", LogLevel.Debug);
7576
});
7677

7778
test("should handle empty parsed object gracefully", () => {

src/env/environment.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,9 +346,8 @@ export function populate(
346346
}
347347
}
348348

349-
// Final debug log to ensure variables are correctly populated
350349
if (debug) {
351-
console.log("Final process.env object:", envObject);
350+
log(`Loaded env keys: ${Object.keys(parsed).join(", ")}`, LogLevel.Debug);
352351
}
353352
}
354353

0 commit comments

Comments
 (0)