Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .jules/sentinel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
## 2023-10-17 - Case-insensitive Environment Variable Filtering
**Vulnerability:** The sandbox stripped sensitive environment variables (like AWS_, OPENAI_ keys) using a case-sensitive prefix check, allowing lowercase equivalents to bypass the filter.
**Learning:** Environment variables may be set using various cases depending on the system or configuration. Hardcoded uppercase prefix matching in JavaScript is insufficient.
**Prevention:** Always convert keys to a uniform case (e.g., uppercase) before checking against prefixes or use case-insensitive regex.
2 changes: 1 addition & 1 deletion packages/core/src/policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ export class PolicyEngine {
if (mode === "sandbox") {
const stripPrefixes = ["AWS_", "OPENAI_", "ANTHROPIC_", "GITHUB_TOKEN", "NPM_TOKEN"];
for (const key of Object.keys(env)) {
if (stripPrefixes.some((prefix) => key.startsWith(prefix))) {
if (stripPrefixes.some((prefix) => key.toUpperCase().startsWith(prefix))) {
delete env[key];
}
}
Expand Down
Loading