rapid7/metasploit-framework

View on GitHub
modules/exploits/multi/http/vtiger_logo_upload_exec.rb

Summary

Maintainability
C
7 hrs
Test Coverage

Method exploit has 50 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def exploit
    cookie = login
    unless cookie
      fail_with(Failure::UnexpectedReply, "#{peer} - Authentication Failed")
    end
Severity: Minor
Found in modules/exploits/multi/http/vtiger_logo_upload_exec.rb - About 2 hrs to fix

    Method initialize has 45 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def initialize(info = {})
        super(update_info(info,
          'Name' => 'Vtiger CRM - Authenticated Logo Upload RCE',
          'Description' => %q{
            Vtiger 6.3.0 CRM's administration interface allows for the upload of a company logo.
    Severity: Minor
    Found in modules/exploits/multi/http/vtiger_logo_upload_exec.rb - About 1 hr to fix

      Method login has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def login
          # Dummy Request for grabbing CSRF token and PHPSESSION ID
          res = send_request_cgi({
            'uri' => normalize_uri(target_uri.path, 'index.php'),
            'vhost' => "#{rhost}",
      Severity: Minor
      Found in modules/exploits/multi/http/vtiger_logo_upload_exec.rb - About 1 hr to fix

        Method exploit has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

          def exploit
            cookie = login
            unless cookie
              fail_with(Failure::UnexpectedReply, "#{peer} - Authentication Failed")
            end
        Severity: Minor
        Found in modules/exploits/multi/http/vtiger_logo_upload_exec.rb - About 55 mins to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Method check has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

          def check
            res = send_request_cgi({ 'uri' => normalize_uri(target_uri.path, 'index.php') })
        
            unless res
              vprint_error("Unable to access the index.php file")
        Severity: Minor
        Found in modules/exploits/multi/http/vtiger_logo_upload_exec.rb - About 45 mins to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Method login has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

          def login
            # Dummy Request for grabbing CSRF token and PHPSESSION ID
            res = send_request_cgi({
              'uri' => normalize_uri(target_uri.path, 'index.php'),
              'vhost' => "#{rhost}",
        Severity: Minor
        Found in modules/exploits/multi/http/vtiger_logo_upload_exec.rb - About 35 mins to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        There are no issues that match your filters.

        Category
        Status