nyx/tests/fixtures/header_injection/ruby/unsafe_subscript_set.rb

10 lines
410 B
Ruby
Raw Permalink Normal View History

2026-05-07 01:29:31 -04:00
# Unsafe: tainted request value flows into the bare-subscript header set
# `response.headers["X-Forwarded-By"] = lang`. The LHS-subscript
# classification path matches `response.headers` as a HEADER_INJECTION
# sink so this form fires alongside the explicit `set_header` /
# `add_header` method-call shapes.
def handle(params, response)
lang = params["lang"]
response.headers["X-Forwarded-By"] = lang
end