rastating/wordpress-exploit-framework

View on GitHub
lib/wpxf/modules/auxiliary/misc/wp_v4.7.1_content_injection.rb

Summary

Maintainability
A
1 hr
Test Coverage

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

  def initialize
    super

    update_info(
      name: 'WordPress 4.7.0 - 4.7.1 Unauthenticated Content Injection',
Severity: Minor
Found in lib/wpxf/modules/auxiliary/misc/wp_v4.7.1_content_injection.rb - About 1 hr to fix

    Avoid comparing a variable with multiple items in a conditional, use Array#include? instead.
    Open

        if version == Gem::Version.new('4.7') || version == Gem::Version.new('4.7.1')
          return :vulnerable if rest_api_is_available
        end

    This cop checks against comparing a variable with multiple items, where Array#include? could be used instead to avoid code repetition.

    Example:

    # bad
    a = 'a'
    foo if a == 'a' || a == 'b' || a == 'c'
    
    # good
    a = 'a'
    foo if ['a', 'b', 'c'].include?(a)

    There are no issues that match your filters.

    Category
    Status