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

Improve handling of unexpected data passed to EventsController. #553

Open
somazx opened this issue Apr 2, 2024 · 0 comments
Open

Improve handling of unexpected data passed to EventsController. #553

somazx opened this issue Apr 2, 2024 · 0 comments

Comments

@somazx
Copy link

somazx commented Apr 2, 2024

Hi,

Should there be some sort of sanity check that events_json decodes to an Array?

We noticed a number of errors reported in our exception logging related to events_controller.rb:25 where the code expects an instance of array. Some values passed in as param events_json will result in the code reaching this point with a nil or integer value instead of an instance of array.

In our case, this was the byproduct of automated fuzzing/penetration testing by a bot (Detectify).

undefined method `first' for nil:NilClass

params:

{
  "action": "create",
  "controller": "ahoy/events",
  "events_json": "nil"
}

undefined method `first' for 41414141:Integer

params

{
  "action": "create",
  "controller": "ahoy/events",
  "events_json": "41414141"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant