From 9b65a20925349dbdc5919041d81cbd12ad8facf1 Mon Sep 17 00:00:00 2001 From: toastal Date: Wed, 15 Apr 2026 01:43:05 +0000 Subject: Phase 1: Fix security vulnerabilities and error handling - Fix command injection in editor.ml using Filename.quote - Change KDL.of_flow to return Result instead of failwith - Update manifest.ml to handle new Result type Security: Prevents shell injection when opening files with malicious filenames containing shell metacharacters. Error handling: KDL parsing errors now return Result type instead of crashing with failwith.--- lib/editor.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/editor.ml') diff --git a/lib/editor.ml b/lib/editor.ml index 49706b4..a68c6b0 100644 --- a/lib/editor.ml +++ b/lib/editor.ml @@ -13,6 +13,6 @@ let find () = let run_on file = match find () with | ed when String.contains ed ' ' -> - Unix.execvp "/bin/sh" [|"/bin/sh"; "-c"; ed ^ " " ^ file|] + Unix.execvp "/bin/sh" [|"/bin/sh"; "-c"; ed ^ " " ^ Filename.quote file|] | ed -> Unix.execvp ed [|ed; file|] -- cgit v1.2.3