Skip to content

Commit

Permalink
Replace YAML load with YAML safe load with allowed classes list (#1258)
Browse files Browse the repository at this point in the history
  • Loading branch information
camertron authored Aug 1, 2022
1 parent 795639a commit d3880f7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/stale-pumpkins-flash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/view-components': patch
---

Replace YAML load with YAML safe load with allowed classes list
9 changes: 3 additions & 6 deletions lib/primer/classify/utilities.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,12 @@ module Primer
class Classify
# Handler for PrimerCSS utility classes loaded from utilities.rake
class Utilities
# Load the utilities.yml file.
# Disabling because we want to load symbols, strings, and integers from the .yml file
# rubocop:disable Security/YAMLLoad
UTILITIES = YAML.load(
UTILITIES = YAML.safe_load(
File.read(
File.join(File.dirname(__FILE__), "./utilities.yml")
)
),
permitted_classes: [Symbol]
).freeze
# rubocop:enable Security/YAMLLoad

BREAKPOINTS = ["", "-sm", "-md", "-lg", "-xl"].freeze

Expand Down

0 comments on commit d3880f7

Please sign in to comment.