brgmnn/sandboxy

View on GitHub

Showing 16 of 16 total issues

RuboCop gem Insecure use of /tmp
Open

    rubocop (0.41.1)
Severity: Info
Found in Gemfile.lock by bundler-audit

Advisory: CVE-2017-8418

Criticality: Low

URL: https://github.com/bbatsov/rubocop/issues/4336

Solution: upgrade to >= 0.49.0

i18n Gem for Ruby lib/i18n/core_ext/hash.rb Hash#slice() Function Hash Handling DoS
Open

    i18n (0.7.0)
Severity: Minor
Found in Gemfile.lock by bundler-audit

Advisory: CVE-2014-10077

URL: https://github.com/svenfuchs/i18n/pull/289

Solution: upgrade to >= 0.8.0

Race condition when using persistent connections
Open

    excon (0.51.0)
Severity: Minor
Found in Gemfile.lock by bundler-audit

Advisory: CVE-2019-16779

Criticality: Medium

URL: https://github.com/excon/excon/security/advisories/GHSA-q58g-455p-8vw9

Solution: upgrade to >= 0.71.0

json Gem for Ruby Unsafe Object Creation Vulnerability (additional fix)
Open

    json (2.0.1)
Severity: Critical
Found in Gemfile.lock by bundler-audit

Advisory: CVE-2020-10663

Criticality: High

URL: https://www.ruby-lang.org/en/news/2020/03/19/json-dos-cve-2020-10663/

Solution: upgrade to >= 2.3.0

ReDoS based DoS vulnerability in Active Support’s underscore
Open

    activesupport (5.0.0)
Severity: Minor
Found in Gemfile.lock by bundler-audit

Advisory: CVE-2023-22796

URL: https://github.com/rails/rails/releases/tag/v7.0.4.1

Solution: upgrade to >= 5.2.8.15, ~> 5.2.8, >= 6.1.7.1, ~> 6.1.7, >= 7.0.4.1

Potentially unintended unmarshalling of user-provided objects in MemCacheStore and RedisCacheStore
Open

    activesupport (5.0.0)
Severity: Minor
Found in Gemfile.lock by bundler-audit

Advisory: CVE-2020-8165

Criticality: Critical

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

Solution: upgrade to >= 5.2.4.3, ~> 5.2.4, >= 6.0.3.1

Method run has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

  def run
    results = Hash.new { |hash, key| hash[key] = {} }

    progress paths do |path|
      id = path.split('/')[-2]
Severity: Minor
Found in lib/sandboxy/commands/run.rb - About 2 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 run has 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def run
    results = Hash.new { |hash, key| hash[key] = {} }

    progress paths do |path|
      id = path.split('/')[-2]
Severity: Minor
Found in lib/sandboxy/commands/run.rb - About 1 hr to fix

    Block has too many lines. [39/25]
    Open

        progress paths do |path|
          id = path.split('/')[-2]
          file, slug, ext = Sandboxy::Path.new(path).info
    
          # Skip any files which do not have a supported file extension
    Severity: Minor
    Found in lib/sandboxy/commands/run.rb by rubocop

    This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

    TZInfo relative path traversal vulnerability allows loading of arbitrary files
    Open

        tzinfo (1.2.2)
    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

    Gems should be sorted in an alphabetical order within their section of the Gemfile. Gem pry should appear before rubocop.
    Open

    gem 'pry'
    Severity: Minor
    Found in Gemfile by rubocop

    Gems should be alphabetically sorted within groups.

    Example:

    # bad
    gem 'rubocop'
    gem 'rspec'
    
    # good
    gem 'rspec'
    gem 'rubocop'
    
    # good
    gem 'rubocop'
    
    gem 'rspec'
    
    # good only if TreatCommentsAsGroupSeparators is true
    # For code quality
    gem 'rubocop'
    # For tests
    gem 'rspec'

    Re-enable Metrics/AbcSize cop with # rubocop:enable after disabling it.
    Open

    # rubocop:disable Metrics/AbcSize
    Severity: Minor
    Found in lib/sandboxy/commands/run.rb by rubocop

    Gems should be sorted in an alphabetical order within their section of the Gemfile. Gem colorize should appear before docker-api.
    Open

    gem 'colorize'
    Severity: Minor
    Found in Gemfile by rubocop

    Gems should be alphabetically sorted within groups.

    Example:

    # bad
    gem 'rubocop'
    gem 'rspec'
    
    # good
    gem 'rspec'
    gem 'rubocop'
    
    # good
    gem 'rubocop'
    
    gem 'rspec'
    
    # good only if TreatCommentsAsGroupSeparators is true
    # For code quality
    gem 'rubocop'
    # For tests
    gem 'rspec'

    Re-enable Metrics/MethodLength cop with # rubocop:enable after disabling it.
    Open

    # rubocop:disable Metrics/MethodLength
    Severity: Minor
    Found in lib/sandboxy/commands/run.rb by rubocop

    Put empty method definitions on a single line.
    Open

      def initialize(args, options)
      end
    Severity: Minor
    Found in lib/sandboxy/commands/build.rb by rubocop

    This cop checks for the formatting of empty method definitions. By default it enforces empty method definitions to go on a single line (compact style), but it can be configured to enforce the end to go on its own line (expanded style).

    Note: A method definition is not considered empty if it contains comments.

    Example: EnforcedStyle: compact (default)

    # bad
    def foo(bar)
    end
    
    def self.foo(bar)
    end
    
    # good
    def foo(bar); end
    
    def foo(bar)
      # baz
    end
    
    def self.foo(bar); end

    Example: EnforcedStyle: expanded

    # bad
    def foo(bar); end
    
    def self.foo(bar); end
    
    # good
    def foo(bar)
    end
    
    def self.foo(bar)
    end

    Use 2 spaces for indentation in a heredoc by using some library(e.g. ActiveSupport's String#strip_heredoc).
    Open

    Run a variety of programs sandboxed in containers
    DESCRIPTION
    Severity: Minor
    Found in lib/sandboxy/app.rb by rubocop

    This cops checks the indentation of the here document bodies. The bodies are indented one step. In Ruby 2.3 or newer, squiggly heredocs (<<~) should be used. If you use the older rubies, you should introduce some library to your project (e.g. ActiveSupport, Powerpack or Unindent). Note: When Metrics/LineLength's AllowHeredoc is false(not default), this cop does not add any offenses for long here documents to avoid Metrics/LineLength's offenses.

    Example:

    # bad
    <<-RUBY
    something
    RUBY
    
    # good
    # When EnforcedStyle is squiggly, bad code is auto-corrected to the
    # following code.
    <<~RUBY
      something
    RUBY
    
    # good
    # When EnforcedStyle is active_support, bad code is auto-corrected to
    # the following code.
    <<-RUBY.strip_heredoc
      something
    RUBY
    Severity
    Category
    Status
    Source
    Language