rapid7/metasploit-framework

View on GitHub
modules/exploits/multi/browser/adobe_flash_pixel_bender_bof.rb

Summary

Maintainability
C
1 day
Test Coverage

Method initialize has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

  def initialize(info={})
    super(update_info(info,
      'Name'           => 'Adobe Flash Player Shader Buffer Overflow',
      'Description'    => %q{
        This module exploits a buffer overflow vulnerability in Adobe Flash Player. The
Severity: Minor
Found in modules/exploits/multi/browser/adobe_flash_pixel_bender_bof.rb - About 3 hrs 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 initialize has 78 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def initialize(info={})
    super(update_info(info,
      'Name'           => 'Adobe Flash Player Shader Buffer Overflow',
      'Description'    => %q{
        This module exploits a buffer overflow vulnerability in Adobe Flash Player. The
Severity: Major
Found in modules/exploits/multi/browser/adobe_flash_pixel_bender_bof.rb - About 3 hrs to fix

    Avoid too many return statements within this method.
    Open

                  return true if ver =~ /^13\./ && Rex::Version.new(ver) <= Rex::Version.new('13.0.0.182')
    Severity: Major
    Found in modules/exploits/multi/browser/adobe_flash_pixel_bender_bof.rb - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                    return true if ver =~ /^11\./ && Rex::Version.new(ver) <= Rex::Version.new('11.2.202.350')
      Severity: Major
      Found in modules/exploits/multi/browser/adobe_flash_pixel_bender_bof.rb - About 30 mins to fix

        Identical blocks of code found in 5 locations. Consider refactoring.
        Open

          def exploit_template(cli, target_info)
            swf_random = "#{rand_text_alpha(4 + rand(3))}.swf"
            target_payload = get_payload(cli, target_info)
            b64_payload = Rex::Text.encode_base64(target_payload)
            os_name = target_info[:os_name]
        Severity: Major
        Found in modules/exploits/multi/browser/adobe_flash_pixel_bender_bof.rb and 4 other locations - About 55 mins to fix
        modules/exploits/multi/browser/adobe_flash_nellymoser_bof.rb on lines 126..151
        modules/exploits/multi/browser/adobe_flash_shader_drawing_fill.rb on lines 111..136
        modules/exploits/multi/browser/adobe_flash_shader_job_overflow.rb on lines 115..140
        modules/exploits/multi/browser/adobe_flash_uncompress_zlib_uaf.rb on lines 111..136

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 44.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Identical blocks of code found in 12 locations. Consider refactoring.
        Open

          def on_request_exploit(cli, request, target_info)
            print_status("Request: #{request.uri}")
        
            if request.uri =~ /\.swf$/
              print_status('Sending SWF...')
        modules/exploits/multi/browser/adobe_flash_hacking_team_uaf.rb on lines 107..117
        modules/exploits/multi/browser/adobe_flash_net_connection_confusion.rb on lines 103..113
        modules/exploits/multi/browser/adobe_flash_opaque_background_uaf.rb on lines 103..113
        modules/exploits/multi/browser/adobe_flash_shader_drawing_fill.rb on lines 98..108
        modules/exploits/multi/browser/adobe_flash_shader_job_overflow.rb on lines 102..112
        modules/exploits/multi/browser/adobe_flash_uncompress_zlib_uaf.rb on lines 98..108
        modules/exploits/windows/browser/adobe_flash_casi32_int_overflow.rb on lines 65..75
        modules/exploits/windows/browser/adobe_flash_copy_pixels_to_byte_array.rb on lines 71..81
        modules/exploits/windows/browser/adobe_flash_domain_memory_uaf.rb on lines 70..80
        modules/exploits/windows/browser/adobe_flash_uncompress_zlib_uninitialized.rb on lines 66..76
        modules/exploits/windows/browser/adobe_flash_worker_byte_array_uaf.rb on lines 65..75

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 36.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        There are no issues that match your filters.

        Category
        Status