Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: remove $SAFE #1021

Merged
merged 1 commit into from
Jan 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/analyzers/feed.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ json: ...

`selector` (`string`) is a `jr` selector.

!!! warning

With great power comes great responsibility.

`jr` can execute anything with the same privilege Mihari has. Do not use untrusted selector.

### Headers

`headers` (`hash`) is an HTTP headers. Optional.
Expand Down
5 changes: 1 addition & 4 deletions lib/mihari/services/feed.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,7 @@ class FeedParser < Service
#
# @param [Object] read_data
def call(input_enumerator, selector)
parsed = proc do
$SAFE = 1
input_enumerator.instance_eval(selector)
end.call
parsed = input_enumerator.instance_eval(selector)

raise TypeError unless parsed.is_a?(Array) || parsed.all?(String)

Expand Down