Skip to content

Real-time network monitor + outbound firewall — see & block every connection. Privacy-first, local-first, Rust fleet agent, SIEM exports, 8 languages. / Moniteur réseau temps réel + pare-feu sortant, agent de flotte Rust, exports SIEM. 100 % local.

security: fix 5 CodeQL findings — own-prop i18n lookup, masked exc, CI permissions

MoneyLisacfc625ae7d10
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 21b8907..3ccb122 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -8,6 +8,11 @@
name: CI
+# EN: Least-privilege token — jobs only need to read the repo.
+# FR: Jeton à moindre privilège — les jobs n'ont besoin que de lire le dépôt.
+permissions:
+ contents: read
+
on:
push:
branches: [main]
diff --git a/backend/api/main.py b/backend/api/main.py
index 605a2b3..25b5dc5 100644
--- a/backend/api/main.py
+++ b/backend/api/main.py
@@ -1380,8 +1380,14 @@ async def get_diagnostics() -> dict:
try:
if log_file.exists():
log_tail = log_file.read_text(errors="replace").splitlines()[-200:]
- except OSError as exc:
- log_tail = [f"<log read failed: {exc}>"]
+ except OSError:
+ # EN: Don't leak the exception text into the API response — the
+ # details stay in the server log, the client gets a generic note.
+ # FR: Ne pas fuiter le texte d'exception dans la réponse API — les
+ # détails restent dans le log serveur, le client reçoit un
+ # message générique.
+ logger.exception("diagnostics: could not read log tail")
+ log_tail = ["<log read failed>"]
db_file = data_dir() / "snitch.db"
return {
diff --git a/frontend/src/i18n.jsx b/frontend/src/i18n.jsx
index 9e4c8dc..6552a95 100644
--- a/frontend/src/i18n.jsx
+++ b/frontend/src/i18n.jsx
@@ -511,8 +511,13 @@ export function I18nProvider({ children }) {
const dict = lang === 'fr' ? fr : en
function t(key, ...args) {
+ // EN: Own-property check — without it, keys like "constructor" would
+ // resolve to inherited Object members (which are callable).
+ // FR: Vérification de propriété propre — sans elle, des clés comme
+ // « constructor » résoudraient vers les membres hérités d'Object
+ // (qui sont appelables).
+ if (!Object.hasOwn(dict, key)) return key
const val = dict[key]
- if (val === undefined) return key
if (typeof val === 'function') return val(...args)
return val
}