The vulnerability is a reflected Cross-Site Scripting (XSS) issue in the Sidekiq-Cron web interface. The root cause is the improper handling of the namespace parameter from the URL. This parameter is assigned to the @current_namespace instance variable in a Sinatra route handler within lib/sidekiq/cron/web.rb. This un-sanitized variable is then directly rendered into the ERB templates lib/sidekiq/cron/views/cron.erb and lib/sidekiq/cron/views/legacy/cron.erb.
The patch addresses this by applying CGI.escapeHTML to the @current_namespace variable within the templates before it is rendered. This ensures that any malicious HTML or JavaScript provided in the URL is properly escaped and not executed by the browser.
During runtime, a profiler would show the rendering of these ERB templates as the point where the vulnerability is triggered. While the templates themselves are not functions, the process of rendering them involves executing embedded Ruby code. Therefore, the vulnerable 'function' is the rendering process of these specific templates when they are passed a malicious @current_namespace.