In rails 1.1.2, the code in ActionController::Routing::ControllerComponent.traverse_to_controller can cause arbitrary files in your path to be loaded. This happens when the second call to "eval" within that method tries to evaluate a module name that does not correspond to a loaded namespace but does match a file in your load path.
Repro steps
What happens
When you shut down you will see output from the ruby profiler. This is because profile.rb was loaded as a result of the web request.
This is the callstack to the code that loads the arbitrary file:
ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:140:in `load'
ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:140:in `load'
ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:56:in `require_or_load'
ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:30:in `depend_on'
ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:85:in `require_dependency'
ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:85:in `require_dependency'
ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:98:in `const_missing'
ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:131:in `const_missing'
ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/routing.rb:249:in `traverse_to_controller'
generated/routing/recognition.rb:3:in `eval'
ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/routing.rb:249:in `traverse_to_controller'
generated/routing/recognition.rb:3:in `recognize_path'
ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/routing.rb:477:in `recognize!'
ruby/gems/1.8/gems/rails-1.1.2/lib/dispatcher.rb:38:in `dispatch'
ruby/gems/1.8/gems/rails-1.1.2/lib/webrick_server.rb:115:in `handle_dispatch'
ruby/gems/1.8/gems/rails-1.1.2/lib/webrick_server.rb:81:in `service'
ruby/1.8/webrick/httpserver.rb:104:in `service'
ruby/1.8/webrick/httpserver.rb:65:in `run'
ruby/1.8/webrick/server.rb:158:in `start_thread'
ruby/1.8/webrick/server.rb:147:in `start'
ruby/1.8/webrick/server.rb:147:in `start_thread'
ruby/1.8/webrick/server.rb:94:in `start'
ruby/1.8/webrick/server.rb:89:in `each'
ruby/1.8/webrick/server.rb:89:in `start'
ruby/1.8/webrick/server.rb:79:in `start'
ruby/1.8/webrick/server.rb:79:in `start'
ruby/gems/1.8/gems/rails-1.1.2/lib/webrick_server.rb:67:in `dispatch'
ruby/gems/1.8/gems/rails-1.1.2/lib/commands/servers/webrick.rb:59
ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in `require__'
ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in `require'
ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:147:in `require'
ruby/gems/1.8/gems/rails-1.1.2/lib/commands/server.rb:30
ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in `require__'
ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in `require'
ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:147:in `require'
script/server:3
I will attach a unit test that demonstrates this.