Skip to content

armgit / strix

Public Imported from GitHub
0

Open-source AI penetration testing tool to find and fix your app’s vulnerabilities.

fix: set restrictive permissions on config file

0xallamfe456d57fece
diff --git a/strix/config/config.py b/strix/config/config.py
index f7f0ccce..351b0802 100644
--- a/strix/config/config.py
+++ b/strix/config/config.py
@@ -74,8 +74,10 @@ class Config:
def save(cls, config: dict[str, Any]) -> bool:
try:
cls.config_dir().mkdir(parents=True, exist_ok=True)
- with cls.config_file().open("w", encoding="utf-8") as f:
+ config_path = cls.config_file()
+ with config_path.open("w", encoding="utf-8") as f:
json.dump(config, f, indent=2)
+ config_path.chmod(0o600)
except OSError:
return False
else: