mirror of
https://github.com/elicpeter/nyx.git
synced 2026-06-24 20:28:06 +02:00
Dynamic (#77)
This commit is contained in:
parent
55247b7fcd
commit
991c84a1eb
1464 changed files with 225448 additions and 1985 deletions
4
tests/dynamic_fixtures/ruby/controller_method/Gemfile
Normal file
4
tests/dynamic_fixtures/ruby/controller_method/Gemfile
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
source 'https://rubygems.org'
|
||||
|
||||
# Phase 15 fixture — generic controller-method shape. No framework
|
||||
# dep is required at runtime; the Gemfile is informational.
|
||||
13
tests/dynamic_fixtures/ruby/controller_method/benign.rb
Normal file
13
tests/dynamic_fixtures/ruby/controller_method/benign.rb
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
# Phase 15 — generic instance method on a controller, benign.
|
||||
|
||||
class LoginController
|
||||
def authenticate(payload)
|
||||
unless payload =~ /\A[A-Za-z0-9]{1,32}\z/
|
||||
STDOUT.print("invalid\n")
|
||||
return "invalid"
|
||||
end
|
||||
out = `echo hello`
|
||||
STDOUT.print(out)
|
||||
out
|
||||
end
|
||||
end
|
||||
12
tests/dynamic_fixtures/ruby/controller_method/vuln.rb
Normal file
12
tests/dynamic_fixtures/ruby/controller_method/vuln.rb
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
# Phase 15 — generic instance method on a controller, vulnerable.
|
||||
# No framework markers — RubyShape::detect picks ControllerMethod
|
||||
# from the class+def pair.
|
||||
|
||||
class LoginController
|
||||
def authenticate(payload)
|
||||
STDOUT.print("__NYX_SINK_HIT__\n")
|
||||
out = `echo hello #{payload}`
|
||||
STDOUT.print(out)
|
||||
out
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue