Skip to content
This repository was archived by the owner on Dec 20, 2025. It is now read-only.

Commit f3bca1e

Browse files
azmavethclaude
andcommitted
feat: add mix_audit and fix security vulnerability
- Add mix_audit dependency for security auditing - Fix high confidence security issue: unsafe binary_to_term usage - Use :safe option to prevent code execution from untrusted data 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent a31386b commit f3bca1e

3 files changed

Lines changed: 4 additions & 1 deletion

File tree

lib/ex_llm/providers/shared/http/cache.ex

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,8 @@ defmodule ExLLM.Providers.Shared.HTTP.Cache.Disk do
341341
case File.read(cache_file) do
342342
{:ok, binary} ->
343343
try do
344-
{:ok, :erlang.binary_to_term(binary)}
344+
# Use safe option to prevent code execution from untrusted data
345+
{:ok, :erlang.binary_to_term(binary, [:safe])}
345346
rescue
346347
ArgumentError -> :error
347348
end

mix.exs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ defmodule ExLLM.MixProject do
135135
{:dialyxir, "~> 1.4", only: [:dev], runtime: false},
136136
{:git_hooks, "~> 0.7", only: [:dev], runtime: false},
137137
{:sobelow, "~> 0.13", only: [:dev, :test], runtime: false},
138+
{:mix_audit, "~> 2.0", only: [:dev, :test], runtime: false},
138139
{:excoveralls, "~> 0.18", only: :test},
139140

140141
# HTTP testing mock server

mix.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"mime": {:hex, :mime, "2.0.7", "b8d739037be7cd402aee1ba0306edfdef982687ee7e9859bee6198c1e7e2f128", [:mix], [], "hexpm", "6171188e399ee16023ffc5b76ce445eb6d9672e2e241d2df6050f3c771e80ccd"},
3737
"mimerl": {:hex, :mimerl, "1.4.0", "3882a5ca67fbbe7117ba8947f27643557adec38fa2307490c4c4207624cb213b", [:rebar3], [], "hexpm", "13af15f9f68c65884ecca3a3891d50a7b57d82152792f3e19d88650aa126b144"},
3838
"mint": {:hex, :mint, "1.7.1", "113fdb2b2f3b59e47c7955971854641c61f378549d73e829e1768de90fc1abf1", [:mix], [{:castore, "~> 0.1.0 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:hpax, "~> 0.1.1 or ~> 0.2.0 or ~> 1.0", [hex: :hpax, repo: "hexpm", optional: false]}], "hexpm", "fceba0a4d0f24301ddee3024ae116df1c3f4bb7a563a731f45fdfeb9d39a231b"},
39+
"mix_audit": {:hex, :mix_audit, "2.1.5", "c0f77cee6b4ef9d97e37772359a187a166c7a1e0e08b50edf5bf6959dfe5a016", [:make, :mix], [{:jason, "~> 1.4", [hex: :jason, repo: "hexpm", optional: false]}, {:yaml_elixir, "~> 2.11", [hex: :yaml_elixir, repo: "hexpm", optional: false]}], "hexpm", "87f9298e21da32f697af535475860dc1d3617a010e0b418d2ec6142bc8b42d69"},
3940
"nimble_options": {:hex, :nimble_options, "1.1.1", "e3a492d54d85fc3fd7c5baf411d9d2852922f66e69476317787a7b2bb000a61b", [:mix], [], "hexpm", "821b2470ca9442c4b6984882fe9bb0389371b8ddec4d45a9504f00a66f650b44"},
4041
"nimble_parsec": {:hex, :nimble_parsec, "1.4.2", "8efba0122db06df95bfaa78f791344a89352ba04baedd3849593bfce4d0dc1c6", [:mix], [], "hexpm", "4b21398942dda052b403bbe1da991ccd03a053668d147d53fb8c4e0efe09c973"},
4142
"nimble_pool": {:hex, :nimble_pool, "1.1.0", "bf9c29fbdcba3564a8b800d1eeb5a3c58f36e1e11d7b7fb2e084a643f645f06b", [:mix], [], "hexpm", "af2e4e6b34197db81f7aad230c1118eac993acc0dae6bc83bac0126d4ae0813a"},

0 commit comments

Comments
 (0)