hpi-swt2/sport-portal

View on GitHub

Showing 179 of 239 total issues

Devise Gem for Ruby confirmation token validation with a blank string
Open

    devise (4.4.1)
Severity: Minor
Found in Gemfile.lock by bundler-audit

Advisory: CVE-2019-16109

Criticality: Medium

URL: https://github.com/plataformatec/devise/issues/5071

Solution: upgrade to >= 4.7.1

Possible XSS vulnerability in ActionView
Open

    actionview (5.1.4)
Severity: Minor
Found in Gemfile.lock by bundler-audit

Advisory: CVE-2020-5267

Criticality: Medium

URL: https://groups.google.com/forum/#!topic/rubyonrails-security/55reWMM_Pg8

Solution: upgrade to >= 5.2.4.2, ~> 5.2.4, >= 6.0.2.2

Improper Restriction of XML External Entity Reference (XXE) in Nokogiri on JRuby
Open

    nokogiri (1.8.2)
Severity: Critical
Found in Gemfile.lock by bundler-audit

Advisory: CVE-2021-41098

Criticality: High

URL: https://github.com/sparklemotion/nokogiri/security/advisories/GHSA-2rr5-8q37-2w7h

Solution: upgrade to >= 1.12.5

Percent-encoded cookies can be used to overwrite existing prefixed cookie names
Open

    rack (2.0.3)
Severity: Critical
Found in Gemfile.lock by bundler-audit

Advisory: CVE-2020-8184

Criticality: High

URL: https://groups.google.com/g/rubyonrails-security/c/OWtmozPH9Ak

Solution: upgrade to ~> 2.1.4, >= 2.2.3

Class Event has 33 methods (exceeds 20 allowed). Consider refactoring.
Open

class Event < ApplicationRecord
  belongs_to :owner, class_name: 'User'
  has_many :matches, -> { order gameday_number: :asc, index: :asc }, dependent: :destroy
  has_many :participants
  has_many :teams, through: :participants
Severity: Minor
Found in app/models/event.rb - About 4 hrs to fix

    Complex method League#round_robin_pairings (31.5)
    Open

        def round_robin_pairings(teams_array)
          teams_array.push nil if teams_array.size.odd?
          n = teams_array.size
          pivot = teams_array.pop
    
    
    Severity: Minor
    Found in app/models/league.rb by flog

    Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.

    You can read more about ABC metrics or the flog tool

    Method new_with_session has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Confirmed

        def new_with_session(_, session)
          super.tap do |user|
            if valid_omniauth_session? session
              data = session['omniauth.data']
              user.uid = data['uid']
    Severity: Minor
    Found in app/models/user.rb - About 1 hr 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

    Complex method User::new_with_session (30.8)
    Confirmed

        def new_with_session(_, session)
          super.tap do |user|
            if valid_omniauth_session? session
              data = session['omniauth.data']
              user.uid = data['uid']
    Severity: Minor
    Found in app/models/user.rb by flog

    Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.

    You can read more about ABC metrics or the flog tool

    Prototype pollution attack through jQuery $.extend
    Open

        jquery-rails (4.3.1)
    Severity: Minor
    Found in Gemfile.lock by bundler-audit

    Advisory: CVE-2019-11358

    Criticality: Medium

    URL: https://blog.jquery.com/2019/04/10/jquery-3-4-0-released/

    Solution: upgrade to >= 4.3.4

    Nokogiri gem, via libxml2, is affected by multiple vulnerabilities
    Open

        nokogiri (1.8.2)
    Severity: Critical
    Found in Gemfile.lock by bundler-audit

    Advisory: CVE-2018-14404

    Criticality: High

    URL: https://github.com/sparklemotion/nokogiri/issues/1785

    Solution: upgrade to >= 1.8.5

    Denial of Service Vulnerability in Rack Content-Disposition parsing
    Open

        rack (2.0.3)
    Severity: Minor
    Found in Gemfile.lock by bundler-audit

    Advisory: CVE-2022-44571

    URL: https://github.com/rack/rack/releases/tag/v3.0.4.1

    Solution: upgrade to >= 2.0.9.2, ~> 2.0.9, >= 2.1.4.2, ~> 2.1.4, >= 2.2.6.1, ~> 2.2.6, >= 3.0.4.1

    Possible XSS vulnerability in Rack
    Open

        rack (2.0.3)
    Severity: Minor
    Found in Gemfile.lock by bundler-audit

    Advisory: CVE-2018-16471

    URL: https://groups.google.com/forum/#!topic/ruby-security-ann/NAalCee8n6o

    Solution: upgrade to ~> 1.6.11, >= 2.0.6

    Users::OmniauthCallbacksController#sign_up_user refers to 'auth' more than self (maybe move it to another class?)
    Confirmed

            uid: auth.uid,
            provider: auth.provider,
            email: auth.info.email,
            first_name: auth.info.first_name,
            last_name: auth.info.last_name,

    Feature Envy occurs when a code fragment references another object more often than it references itself, or when several clients do the same series of manipulations on a particular type of object.

    Feature Envy reduces the code's ability to communicate intent: code that "belongs" on one class but which is located in another can be hard to find, and may upset the "System of Names" in the host class.

    Feature Envy also affects the design's flexibility: A code fragment that is in the wrong class creates couplings that may not be natural within the application's domain, and creates a loss of cohesion in the unwilling host class.

    Feature Envy often arises because it must manipulate other objects (usually its arguments) to get them into a useful form, and one force preventing them (the arguments) doing this themselves is that the common knowledge lives outside the arguments, or the arguments are of too basic a type to justify extending that type. Therefore there must be something which 'knows' about the contents or purposes of the arguments. That thing would have to be more than just a basic type, because the basic types are either containers which don't know about their contents, or they are single objects which can't capture their relationship with their fellows of the same type. So, this thing with the extra knowledge should be reified into a class, and the utility method will most likely belong there.

    Example

    Running Reek on:

    class Warehouse
      def sale_price(item)
        (item.price - item.rebate) * @vat
      end
    end

    would report:

    Warehouse#total_price refers to item more than self (FeatureEnvy)

    since this:

    (item.price - item.rebate)

    belongs to the Item class, not the Warehouse.

    UsersController has at least 18 methods
    Open

    class UsersController < Devise::RegistrationsController
    Severity: Minor
    Found in app/controllers/users_controller.rb by reek

    Too Many Methods is a special case of LargeClass.

    Example

    Given this configuration

    TooManyMethods:
      max_methods: 3

    and this code:

    class TooManyMethods
      def one; end
      def two; end
      def three; end
      def four; end
    end

    Reek would emit the following warning:

    test.rb -- 1 warning:
      [1]:TooManyMethods has at least 4 methods (TooManyMethods)

    Revert libxml2 behavior in Nokogiri gem that could cause XSS
    Open

        nokogiri (1.8.2)
    Severity: Minor
    Found in Gemfile.lock by bundler-audit

    Advisory: CVE-2018-8048

    URL: https://github.com/sparklemotion/nokogiri/pull/1746

    Solution: upgrade to >= 1.8.3

    Path Traversal in Sprockets
    Open

        sprockets (3.7.1)
    Severity: Critical
    Found in Gemfile.lock by bundler-audit

    Advisory: CVE-2018-3760

    Criticality: High

    URL: https://groups.google.com/forum/#!topic/ruby-security-ann/2S9Pwz2i16k

    Solution: upgrade to < 3.0.0, >= 2.12.5, < 4.0.0, >= 3.7.2, >= 4.0.0.beta8

    TZInfo relative path traversal vulnerability allows loading of arbitrary files
    Open

        tzinfo (1.2.4)
    Severity: Critical
    Found in Gemfile.lock by bundler-audit

    Advisory: CVE-2022-31163

    Criticality: High

    URL: https://github.com/tzinfo/tzinfo/security/advisories/GHSA-5cm2-9h8c-rvfx

    Solution: upgrade to ~> 0.3.61, >= 1.2.10

    Denial of Service Vulnerability in Rack Multipart Parsing
    Open

        rack (2.0.3)
    Severity: Critical
    Found in Gemfile.lock by bundler-audit

    Advisory: CVE-2022-30122

    Criticality: High

    URL: https://groups.google.com/g/ruby-security-ann/c/L2Axto442qk

    Solution: upgrade to >= 2.0.9.1, ~> 2.0.9, >= 2.1.4.1, ~> 2.1.4, >= 2.2.3.1

    Denial of service via header parsing in Rack
    Open

        rack (2.0.3)
    Severity: Minor
    Found in Gemfile.lock by bundler-audit

    Advisory: CVE-2022-44570

    URL: https://github.com/rack/rack/releases/tag/v3.0.4.1

    Solution: upgrade to >= 2.0.9.2, ~> 2.0.9, >= 2.1.4.2, ~> 2.1.4, >= 2.2.6.2, ~> 2.2.6, >= 3.0.4.1

    OS Command Injection in Rake
    Open

        rake (12.3.0)
    Severity: Critical
    Found in Gemfile.lock by bundler-audit

    Advisory: CVE-2020-8130

    Criticality: High

    URL: https://github.com/advisories/GHSA-jppv-gw3r-w3q8

    Solution: upgrade to >= 12.3.3

    Severity
    Category
    Status
    Source
    Language