CVE-2022-23079 (published 2022-06-22T13:15Z)

In motor-admin versions 0.0.1 through 0.2.56 are vulnerable to host header injection in the password reset functionality where malicious actor can send fake password reset email to arbitrary victim.

Severity: MEDIUM
CVSS v2 base score: 6.8 (AV:N/AC:M/Au:N/C:P/I:P/A:P)

Weakness information:
cwe_id: CWE-116
cwe_name: Improper Encoding or Escaping of Output
description: The product prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. As a result, the intended structure of the message is not preserved.
extended_description: 
            Improper encoding or escaping can allow attackers to change the commands that are sent to another component, inserting malicious commands instead.
            Most products follow a certain protocol that uses structured messages for communication between components, such as queries or commands. These structured messages can contain raw data interspersed with metadata or control information. For example, "GET /index.html HTTP/1.1" is a structured message containing a command ("GET") with a single argument ("/index.html") and metadata about which protocol version is being used ("HTTP/1.1").
            If an application uses attacker-supplied inputs to construct a structured message without properly encoding or escaping, then the attacker could insert special characters that will cause the data to be interpreted as control information or metadata. Consequently, the component that receives the output will perform the wrong operations, or otherwise interpret the data incorrectly.
         
         

Fix information:
repo_url: https://github.com/motor-admin/motor-admin
commit_details: repo_url: https://github.com/motor-admin/motor-admin
author: Pete Matsyburka
author_date: 2022-01-20 18:39:40+02:00
msg: do not use request host in for devise
repository: repo_url: https://github.com/motor-admin/motor-admin
repo_name: motor-admin/motor-admin
description: Deploy a no-code admin panel for any application in less than a minute. Search, create, update, and delete data entries, create custom actions, and build reports.
repo_language: Ruby
owner: motor-admin
file_changes: filename: admin_users_controller.rb
change_type: ModificationType.MODIFY
diff: @@ -42,7 +42,7 @@ module Api
 
       authorize!(:manage, @admin_user)
 
-      Devise::Mailer.default_url_options = { host: request.host, protocol: request.protocol, port: request.port }
+      Devise::Mailer.default_url_options = { host: ENV['HOST'], protocol: request.protocol, port: request.port }
 
       @admin_user.send_reset_password_instructions
 

programming_language: Ruby
filename: application_controller.rb
change_type: ModificationType.MODIFY
diff: @@ -7,7 +7,7 @@ class ApplicationController < ActionController::Base
   before_action :authenticate_admin_user!, unless: :setup_path?
 
   before_action do
-    Devise::Mailer.default_url_options = { host: request.host, protocol: request.protocol, port: request.port }
+    Devise::Mailer.default_url_options = { host: ENV['HOST'], protocol: request.protocol, port: request.port }
   end
 
   private

programming_language: Ruby