Skip to content

Commit

Permalink
Use File.read instead of Kernel.open
Browse files Browse the repository at this point in the history
To avoid command injection with | strings
  • Loading branch information
inukshuk committed Jan 17, 2020
1 parent 707b930 commit 14406f4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/bibtex/bibliography.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class << self
# -:filter: convert all entries using the sepcified filter (not set by default)
#
def open(path, options = {})
b = parse(Kernel.open(path, 'r:UTF-8').read, options)
b = parse(File.read(path), options)
b.path = path
return b unless block_given?

Expand Down

0 comments on commit 14406f4

Please sign in to comment.