-
-
Notifications
You must be signed in to change notification settings - Fork 541
wololo! #3056
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
base: master
Are you sure you want to change the base?
wololo! #3056
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,6 +25,7 @@ | |
| require "sentry/threaded_periodic_worker" | ||
| require "sentry/session_flusher" | ||
| require "sentry/backpressure_monitor" | ||
| require "sentry/wololo" | ||
| require "sentry/cron/monitor_check_ins" | ||
| require "sentry/vernier/profiler" | ||
| require "sentry/metrics" | ||
|
|
@@ -59,6 +60,7 @@ | |
| logger | ||
| session_flusher | ||
| backpressure_monitor | ||
| wololo | ||
| exception_locals_tp | ||
| ].freeze | ||
|
|
||
|
|
@@ -92,6 +94,10 @@ | |
| # @return [BackpressureMonitor, nil] | ||
| attr_reader :backpressure_monitor | ||
|
|
||
| # @!attribute [r] wololo | ||
| # @return [Wololo, nil] | ||
| attr_reader :wololo | ||
|
|
||
| ##### Patch Registration ##### | ||
|
|
||
| # @!visibility private | ||
|
|
@@ -277,6 +283,7 @@ | |
| @background_worker = Sentry::BackgroundWorker.new(config) | ||
| @session_flusher = config.session_tracking? ? Sentry::SessionFlusher.new(config, client) : nil | ||
| @backpressure_monitor = config.enable_backpressure_handling ? Sentry::BackpressureMonitor.new(config, client) : nil | ||
| @wololo = config.wololo ? Sentry::Wololo.new(config) : nil | ||
|
Check failure on line 286 in sentry-ruby/lib/sentry-ruby.rb
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Opt-in Wololo sends unredacted application source and exception data to OpenRouter When an application enables Evidence
Identified by Warden · security-review · NKH-YZD |
||
| exception_locals_tp.enable if config.include_local_variables | ||
| at_exit { close } | ||
| end | ||
|
|
@@ -297,6 +304,11 @@ | |
| @backpressure_monitor = nil | ||
| end | ||
|
|
||
| if @wololo | ||
| @wololo.kill | ||
| @wololo = nil | ||
| end | ||
|
|
||
| if client = get_current_client | ||
| client.configuration.run_after_close_callbacks | ||
| client.flush | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Untrusted LLM patch output is evaluated as Ruby, enabling RCE
When Wololo is enabled, the remote LLM response is treated as Ruby source and evaluated in TOPLEVEL_BINDING without enforcing that it contains only method definitions. A response containing one valid method plus a top-level operation such as system, file access, or network access can therefore execute arbitrary code in the application process; request-controlled exception data is included in the LLM prompt and can enable prompt injection.
Evidence
Hub#capture_exception, which callsSentry.wololo&.record(exception)when the opt-in worker is enabled.Wololo#request_patchembeds the exception message, backtrace, and source files in a prompt and accepts the remotechat.askresponse as patch data.apply_patcheschecks syntax, safe file paths, loaded targets, source locations, and a small forbidden method-name list, but does not enforce an AST-level method-only structure. A patch such asdef existing; end\nsystem('...')can satisfy the target/source checks.apply_prepend_patchinterpolates that source intoTOPLEVEL_BINDING.eval("Module.new {\n#{source}\n}", ...), executing the top-level operation immediately in the application process before prepending the module.Also found at 4 additional locations
sentry-ruby/lib/sentry/hub.rb:174-174sentry-ruby/lib/sentry/wololo.rb:91-99sentry-ruby/lib/sentry/wololo.rb:386-388sentry-ruby/lib/sentry/wololo.rb:426-501Identified by Warden · security-review · NWG-8RS