瀏覽代碼

Use YAML.unsafe_load

Akinori MUSHA 1 年之前
父節點
當前提交
2a417bf534
共有 1 個文件被更改,包括 1 次插入2 次删除
  1. 1 2
      app/helpers/jobs_helper.rb

+ 1 - 2
app/helpers/jobs_helper.rb

@@ -1,5 +1,4 @@
 module JobsHelper
-
   def status(job)
     case
     when job.failed_at
@@ -24,7 +23,7 @@ module JobsHelper
   #
   # Can return nil, or an instance of Agent.
   def agent_from_job(job)
-    data = YAML.load(job.handler.to_s).try(:job_data)
+    data = YAML.unsafe_load(job.handler.to_s).try(:job_data)
     case data['job_class']
     when 'AgentCheckJob', 'AgentReceiveJob'
       Agent.find_by_id(data['arguments'][0])