chore(deps)(deps): Update alembic requirement from >=1.14.0 to >=1.18.4 in /backend#7
Open
dependabot[bot] wants to merge 1 commit into
Open
chore(deps)(deps): Update alembic requirement from >=1.14.0 to >=1.18.4 in /backend#7dependabot[bot] wants to merge 1 commit into
dependabot[bot] wants to merge 1 commit into
Conversation
Contributor
Author
LabelsThe following labels could not be found: Please fix the above issues or remove invalid values from |
11 tasks
kevinggraphiste-hub
added a commit
that referenced
this pull request
May 27, 2026
…rketplace, WS, path traversal) (#23) * fix(security): hardening critique — 5 fixes audit 2026-05-26 Cinq trous chirurgicaux relevés par l'audit sécu d'hier soir. Items #5, #6, #7, #8, #10 du rapport (OAuth #2/#3 et impersonation #9 reportés à demain car trop sensibles pour passer à 23h). ## #10 — IDOR Tasks (task_routes.py) Les 5 routes /conversations/{id}/tasks* ne vérifiaient AUCUNE ownership. Tout user authentifié pouvait lister/créer/modifier/wiper la to-do d'un autre. Fix : helper _ensure_owned_conversation au top de chaque route. Mode setup (≤1 user, middleware skip) toléré comme avant. ## #6 — Marketplace install ouvert à tous (marketplace_routes.py) POST /marketplace/install et /uninstall n'exigaient qu'auth (pas admin). Installer un plugin = exécution Python globale + accès vault secrets de TOUS les users → RCE instance-wide via trial user. Gate require_admin ajoutée sur les deux endpoints. ## #7 — Path traversal plugin_id (marketplace.py) shutil.rmtree(EXTERNAL_PLUGINS_DIR / plugin_id) prenait n'importe quoi. Un admin pouvait wiper la prod avec ../../backend. Whitelist regex ^[a-z0-9][a-z0-9_.-]{0,63}$ + ceinture .resolve() qui vérifie que le chemin reste sous EXTERNAL_PLUGINS_DIR (anti-symlink). ## #8 — SSRF KB ingest URL (kb/extractors/url.py) POST /api/plugins/kb/ingest/url ne checkait que le scheme. Un user pouvait hit 169.254.169.254 (cloud metadata → IAM creds) ou les services internes (Postgres, Redis, MCP, Ollama) et stocker la réponse dans sa KB. Fix : _is_private_url (helper existant dans web_fetch) + suivi manuel des redirects avec re-check à chaque hop (sinon site public peut rediriger vers IP privée — cf. fix C2 du browser plugin). ## #5 — Voice WebSocket auth bypass (voice_routes.py) Le handler /voice/realtime/{engine} lisait user_id depuis query_params sans validation. Anyone pouvait ?user_id=1 et burner les clés API de l'admin. Pattern fix existait déjà dans plugins/code/routes/lsp.py (cookie HttpOnly pendant le handshake WS). Adaptation locale : helper _authenticate_voice_ws, refus avant accept() si pas d'auth valide. Pas de migration DB. Pas de touche aux outils agent (WOLF, file_*). Autoamélioration intacte. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(security): suite ultrareview PR #23 — voice WS open-mode + KB streaming Ultrareview PR #23 a remonté 3 findings. Cette commit fixe les deux fixables sans refacto large. Le 3e (SSRF helper IPv6 + DNS rebinding, pre-existing dans web_fetch.py) est documenté comme reporté. ## #4 — Voice WS open-mode bypass (régression introduite par cette PR) Mon helper _authenticate_voice_ws (copié du pattern LSP) retournait user_id=0 dès que `has_tokens == False`. Le middleware HTTP exige aussi `user_count <= 1` (cf. main.py:949-967, incident 2026-05-05 : quand tout le monde fait logout dans une instance multi-users, les api_token deviennent NULL → has_tokens=False → open mode ré-ouvert à tout attacker non auth). Fix : aligner exactement sur le middleware (`has_tokens=False AND user_count <= 1`). Sans ça, l'attacker pouvait se connecter en WS comme share user et burner les clés API instance-wide — exactement ce que la PR voulait fermer. Note : le pattern original dans plugins/code/routes/lsp.py a le même défaut pré-existant. Sera fixé en PR séparée (out-of-scope ici). ## #10 — KB extract_url buffere le body avant le check de taille httpx.Client.get() est NON-streaming : le body entier est matérialisé en RAM avant que MAX_FETCH_BYTES soit testé. Un serveur hostile peut annoncer text/html + servir un body multi-GB → OOM du worker. Fix : passage à client.stream("GET", ...) + iter_bytes() qui coupe dès que la taille cumulée dépasse le cap. Bonus : reject précoce si Content-Length annonce > MAX_FETCH_BYTES. ## #1 — REPORTÉ (PR séparée) SSRF helper _is_private_url (web_fetch.py) a deux trous pré-existants qui défont partiellement la garde KB ajoutée par cette PR : - IPv6 non validé (socket.gethostbyname est IPv4-only ; literals comme [fd00:ec2::254] passent → AWS IMDS v6 reste exfiltrable) - DNS rebinding TOCTOU (helper résout, puis httpx re-résout au connect ; un DNS attacker peut flip entre les deux lookups) Le vrai fix demande de refactor le helper avec ipaddress.ip_address() + getaddrinfo AF_UNSPEC + custom httpx transport qui pin l'IP validée (Host/SNI préservés). Trop large pour 23h. Tracking : à faire en priorité dans la prochaine PR sécu. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Kevin <kevin@gungnir.dev> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
71bc5a3 to
4789092
Compare
Updates the requirements on [alembic](https://github.com/sqlalchemy/alembic) to permit the latest version. - [Release notes](https://github.com/sqlalchemy/alembic/releases) - [Changelog](https://github.com/sqlalchemy/alembic/blob/main/CHANGES) - [Commits](https://github.com/sqlalchemy/alembic/commits) --- updated-dependencies: - dependency-name: alembic dependency-version: 1.18.4 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com>
4789092 to
f1952be
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updates the requirements on alembic to permit the latest version.
Release notes
Sourced from alembic's releases.
Commits