autolab / Autolab

Course management service that enables auto-graded programming assignments.
http://www.autolabproject.com/
Apache License 2.0
766 stars 220 forks source link

passwords#create (NoMethodError) "undefined method `add' for nil:NilClass #2176

Open abrantesasf opened 2 months ago

abrantesasf commented 2 months ago

Your environment

Steps To Reproduce Do not know. I'm not sure if this is a bug, a misconfiguration of my part or some other kind of problem.

Current behavior Today, from 01:36h to 02:18h, I got 722 emails messages from Autolab. The subject of messages is "passwords#create (NoMethodError) "undefined method `add' for nil:NilClass". Every message looks like the following:

A NoMethodError occurred in passwords#create:

undefined method add' for nil:NilClass app/models/course_logger.rb:26:inlog'


Request:


Session:


Environment:


Backtrace:

app/models/course_logger.rb:26:in log' app/controllers/application_controller.rb:32:inblock in '

Expected behavior Not sure, because I do not know what this alert messages are all about.

Screenshots None

cg2v commented 2 months ago

"user"=>{"email"=>"1%' UNION ALL SELECT NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL#"}

This suggests that someone is attacking your installation, trying to identify an SQL injection vulnerability. I believe it's unlikely that one actually exists here.

The error is triggered because autolab is trying to log a message before the COURSE_LOGGER object has been properly configured. It may or may not work for the order of the set_course and authenticate_user! before actions in application_controller.rb to be swapped

abrantesasf commented 2 months ago

Thanks for the clarification! I'll ask the infrastrucutre team on my University to check IPs causing this messages to take actions. Thanks again.

"user"=>{"email"=>"1%' UNION ALL SELECT NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL#"}

This suggests that someone is attacking your installation, trying to identify an SQL injection vulnerability. I believe it's unlikely that one actually exists here.

The error is triggered because autolab is trying to log a message before the COURSE_LOGGER object has been properly configured. It may or may not work for the order of the set_course and authenticate_user! before actions in application_controller.rb to be swapped