From 1ed8dd31c8117f59986b708e2a0f96da8f690aa4 Mon Sep 17 00:00:00 2001 From: Justin Collins Date: Sun, 29 Dec 2024 16:57:47 -0700 Subject: [PATCH] Don't warn about evaluating a safe value --- lib/brakeman/checks/check_evaluation.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/brakeman/checks/check_evaluation.rb b/lib/brakeman/checks/check_evaluation.rb index 47f329dca..1568ce4b2 100644 --- a/lib/brakeman/checks/check_evaluation.rb +++ b/lib/brakeman/checks/check_evaluation.rb @@ -28,6 +28,8 @@ def process_result result elsif string_evaluation? result[:call].first_arg confidence = :low message = "Dynamic string evaluated as code" + elsif safe_literal? result[:call].first_arg + # don't warn elsif result[:call].method == :eval confidence = :low message = "Dynamic code evaluation"