Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions ruby/ql/lib/codeql/ruby/frameworks/core/Gem.qll
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ module Gem {
result = this.getAPublicModule().getStmt(_).(SingletonClass)
}

/** Holds if this gem is vendored in this codebase. */
predicate isVendored() { File.super.getParentContainer+().getBaseName() = "vendor" }

/** Gets a parameter from an exported method, which is an input to this gem. */
DataFlow::ParameterNode getAnInputParameter() {
exists(MethodBase method |
Expand All @@ -107,6 +110,7 @@ module Gem {
DataFlow::ParameterNode getALibraryInput() {
exists(GemSpec spec |
exists(spec.getName()) and // we only consider `.gemspec` files that have a name
not spec.isVendored() and // if the gem is vendored its parameters are not external inputs
result = spec.getAnInputParameter()
)
}
Expand Down
Loading