Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reapply - Fix invalid browser name, version and plugins messages (#3051) #3183

Open
wants to merge 55 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
3480fd3
Reapply "Merge branch 'pr/zinduolis/3149-3'"
zinduolis Oct 26, 2024
ed35c2f
Bump rubocop from 1.66.1 to 1.67.0
dependabot[bot] Oct 27, 2024
2cbe73a
Merge remote-tracking branch 'origin/master' into 3182_Resubmit_PR
zinduolis Oct 28, 2024
6976117
Improve security of browser version matching regex
zinduolis Oct 29, 2024
147137b
Allow for four digit segments
zinduolis Oct 29, 2024
e27704d
Merge pull request #3165 from beefproject/dependabot/bundler/rubocop-…
zinduolis Oct 30, 2024
864336a
Bump rack from 2.2.9 to 2.2.10
dependabot[bot] Oct 30, 2024
f0b0b7f
Merge pull request #3164 from beefproject/dependabot/bundler/rack-2.2.10
zinduolis Oct 30, 2024
96563d5
Bump rexml from 3.3.8 to 3.3.9
dependabot[bot] Oct 30, 2024
092a277
Merge pull request #3185 from beefproject/dependabot/bundler/rexml-3.3.9
zinduolis Oct 30, 2024
e9371c2
Bump json from 2.7.2 to 2.7.4
dependabot[bot] Oct 30, 2024
8d1693c
Merge pull request #3181 from beefproject/dependabot/bundler/json-2.7.4
zinduolis Oct 30, 2024
7f41338
Bump execjs from 2.9.1 to 2.10.0
dependabot[bot] Oct 30, 2024
362cff2
Merge pull request #3178 from beefproject/dependabot/bundler/execjs-2…
zinduolis Oct 30, 2024
9e4374a
Bump otr-activerecord from 2.2.0 to 2.4.0
dependabot[bot] Oct 30, 2024
aed85df
Merge pull request #3166 from beefproject/dependabot/bundler/otr-acti…
zinduolis Oct 30, 2024
6ebf8d6
Bump selenium-webdriver from 4.25.0 to 4.26.0
dependabot[bot] Oct 30, 2024
ced9bb3
Merge pull request #3192 from beefproject/dependabot/bundler/selenium…
zinduolis Oct 31, 2024
8e4a754
Bump json from 2.7.4 to 2.7.5
dependabot[bot] Oct 31, 2024
63513f8
Merge pull request #3191 from beefproject/dependabot/bundler/json-2.7.5
zinduolis Oct 31, 2024
e75022d
Bump rubocop from 1.67.0 to 1.68.0
dependabot[bot] Oct 31, 2024
59b3306
Merge pull request #3196 from beefproject/dependabot/bundler/rubocop-…
zinduolis Nov 1, 2024
7527173
Upgrade activerecord to 7.2 and refactor code for new version
zinduolis Nov 4, 2024
4043f46
Add current version of ruby for automated testing
zinduolis Nov 4, 2024
45b61e9
Remove version from gh action
zinduolis Nov 4, 2024
2ce3ad7
Update checkout action to the current version
zinduolis Nov 4, 2024
6252342
Bump jsdoc-to-markdown from 9.0.4 to 9.0.5
dependabot[bot] Nov 4, 2024
8b5fdcf
Merge pull request #3203 from beefproject/dependabot/npm_and_yarn/jsd…
zinduolis Nov 5, 2024
bb7e145
Update gh action to run of workflow code in PR
zinduolis Nov 5, 2024
e1a4716
Revert gh action update
zinduolis Nov 5, 2024
29db262
Revert one more gh action change
zinduolis Nov 5, 2024
8183a07
Update checkout and ruby versions
zinduolis Nov 5, 2024
150f065
Merge pull request #3204 from zinduolis/update_gh_actions
zinduolis Nov 5, 2024
a62cb63
Upgrade activerecord to 7.2 and refactor code for new version
zinduolis Nov 4, 2024
ce528f1
Update gh action to run of workflow code in PR
zinduolis Nov 5, 2024
15c091e
Revert gh action update
zinduolis Nov 5, 2024
752ab1c
Revert one more gh action change
zinduolis Nov 5, 2024
05ba4b8
Merge branch 'activerecord_upgrade_to_7_2' of https://github.com/zind…
zinduolis Nov 6, 2024
5bd0752
Resolving merge conflicts
zinduolis Nov 6, 2024
23b8e89
Add current version of ruby for automated testing
zinduolis Nov 4, 2024
32ad62f
Remove version from gh action
zinduolis Nov 4, 2024
b80b0ff
Update gh action to run of workflow code in PR
zinduolis Nov 5, 2024
f7b0525
Revert gh action update
zinduolis Nov 5, 2024
fb211c2
Revert one more gh action change
zinduolis Nov 5, 2024
5205c33
Resolving merge conflicts
zinduolis Nov 6, 2024
17fb0cf
Merge branch 'activerecord_upgrade_to_7_2' of https://github.com/zind…
zinduolis Nov 6, 2024
3136718
Merge pull request #3202 from zinduolis/activerecord_upgrade_to_7_2
zinduolis Nov 6, 2024
5049850
Bump sqlite3 from 1.7.3 to 2.2.0
dependabot[bot] Nov 6, 2024
66e234e
Merge pull request #3195 from beefproject/dependabot/bundler/sqlite3-…
zinduolis Nov 6, 2024
c1126bf
Bump json from 2.7.5 to 2.7.6
dependabot[bot] Nov 6, 2024
41f04d1
Merge pull request #3205 from beefproject/dependabot/bundler/json-2.7.6
zinduolis Nov 6, 2024
ad23184
Reapply "Merge branch 'pr/zinduolis/3149-3'"
zinduolis Oct 26, 2024
e612a24
Improve security of browser version matching regex
zinduolis Oct 29, 2024
f383da0
Allow for four digit segments
zinduolis Oct 29, 2024
18f2d6d
Merge branch '3182_Resubmit_PR' of https://github.com/zinduolis/beef …
zinduolis Nov 6, 2024
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
3 changes: 1 addition & 2 deletions .github/workflows/github_actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ jobs:

- name: 'Setting up Ruby'
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0.3 # Not needed with a .ruby-version file
# Ruby version is defined in .ruby-version file

- name: 'Update and Install Dependencies'
run: |
Expand Down
12 changes: 6 additions & 6 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ gem 'rack-protection', '~> 3.2.0'
gem 'em-websocket', '~> 0.5.3' # WebSocket support
gem 'uglifier', '~> 4.2'
gem 'mime-types', '~> 3.6'
gem 'execjs', '~> 2.9'
gem 'execjs', '~> 2.10'
gem 'ansi', '~> 1.5'
gem 'term-ansicolor', :require => 'term/ansicolor'
gem 'rubyzip', '~> 2.3'
gem 'espeak-ruby', '~> 1.1.0' # Text-to-Voice
gem 'rake', '~> 13.2'
gem 'activerecord', '~> 7.0'
gem 'otr-activerecord', '~> 2.2.0'
gem 'sqlite3', '~> 1.4'
gem 'rubocop', '~> 1.66.1', require: false
gem 'activerecord', '~> 7.2'
gem 'otr-activerecord', '~> 2.4.0'
gem 'sqlite3', '~> 2.2'
gem 'rubocop', '~> 1.68.0', require: false

# Geolocation support
group :geoip do
Expand Down Expand Up @@ -79,7 +79,7 @@ group :test do
# Note: selenium-webdriver 3.x is incompatible with Firefox version 48 and prior
# gem 'selenium' # Requires old version of selenium which is no longer available
gem 'geckodriver-helper', '~> 0.24.0'
gem 'selenium-webdriver', '~> 4.25'
gem 'selenium-webdriver', '~> 4.26'

# Note: nokogiri is needed by capybara which may require one of the below commands
# sudo apt-get install libxslt-dev libxml2-dev
Expand Down
75 changes: 39 additions & 36 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
GEM
remote: https://rubygems.org/
specs:
activemodel (7.1.4.2)
activesupport (= 7.1.4.2)
activerecord (7.1.4.2)
activemodel (= 7.1.4.2)
activesupport (= 7.1.4.2)
activemodel (7.2.2)
activesupport (= 7.2.2)
activerecord (7.2.2)
activemodel (= 7.2.2)
activesupport (= 7.2.2)
timeout (>= 0.4.0)
activesupport (7.1.4.2)
activesupport (7.2.2)
base64
benchmark (>= 0.3)
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
concurrent-ruby (~> 1.0, >= 1.3.1)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
logger (>= 1.4.2)
minitest (>= 5.1)
mutex_m
tzinfo (~> 2.0)
securerandom (>= 0.3)
tzinfo (~> 2.0, >= 2.0.5)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
ansi (1.5.0)
Expand All @@ -32,6 +34,7 @@ GEM
async-io (1.43.2)
async
base64 (0.2.0)
benchmark (0.3.0)
bigdecimal (3.1.8)
browserstack-local (1.4.3)
byebug (11.1.3)
Expand Down Expand Up @@ -63,7 +66,7 @@ GEM
espeak-ruby (1.1.0)
event_emitter (0.2.6)
eventmachine (1.2.7)
execjs (2.9.1)
execjs (2.10.0)
fiber-annotation (0.2.0)
fiber-local (1.1.0)
fiber-storage
Expand All @@ -84,7 +87,7 @@ GEM
irb (1.14.1)
rdoc (>= 4.0.0)
reline (>= 0.4.2)
json (2.7.2)
json (2.7.6)
language_server-protocol (3.17.0.3)
logger (1.6.1)
matrix (0.4.2)
Expand All @@ -102,13 +105,12 @@ GEM
msgpack (1.7.3)
mustermann (3.0.3)
ruby2_keywords (~> 0.0.1)
mutex_m (0.2.0)
net-protocol (0.2.2)
timeout
net-smtp (0.5.0)
net-protocol
netrc (0.11.0)
nio4r (2.7.3)
nio4r (2.7.4)
nokogiri (1.16.7-aarch64-linux)
racc (~> 1.4)
nokogiri (1.16.7-arm-linux)
Expand All @@ -121,12 +123,12 @@ GEM
racc (~> 1.4)
nokogiri (1.16.7-x86_64-linux)
racc (~> 1.4)
otr-activerecord (2.2.0)
activerecord (>= 4.0, < 7.2)
otr-activerecord (2.4.0)
activerecord (>= 6.0, < 7.3)
hashie-forbidden_attributes (~> 0.1)
parallel (1.26.3)
parseconfig (1.1.2)
parser (3.3.5.0)
parser (3.3.5.1)
ast (~> 2.4.1)
racc
power_assert (2.0.4)
Expand All @@ -143,7 +145,7 @@ GEM
mojo_magick (~> 0.6.5)
rqrcode_core (~> 1.0)
racc (1.8.1)
rack (2.2.9)
rack (2.2.10)
rack-protection (3.2.0)
base64 (>= 0.1.0)
rack (~> 2.2, >= 2.2.4)
Expand All @@ -161,14 +163,14 @@ GEM
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 4.0)
netrc (~> 0.8)
rexml (3.3.8)
rexml (3.3.9)
rqrcode_core (1.2.0)
rr (3.1.1)
rspec (3.13.0)
rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0)
rspec-mocks (~> 3.13.0)
rspec-core (3.13.1)
rspec-core (3.13.2)
rspec-support (~> 3.13.0)
rspec-expectations (3.13.3)
diff-lcs (>= 1.2.0, < 2.0)
Expand All @@ -177,7 +179,7 @@ GEM
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-support (3.13.1)
rubocop (1.66.1)
rubocop (1.68.0)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
Expand All @@ -187,15 +189,16 @@ GEM
rubocop-ast (>= 1.32.2, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.32.3)
rubocop-ast (1.33.1)
parser (>= 3.3.1.0)
ruby-progressbar (1.13.0)
ruby2_keywords (0.0.5)
rubyzip (2.3.2)
rushover (0.3.0)
json
rest-client
selenium-webdriver (4.25.0)
securerandom (0.3.1)
selenium-webdriver (4.26.0)
base64 (~> 0.2)
logger (~> 1.4)
rexml (~> 3.2, >= 3.2.5)
Expand All @@ -207,12 +210,12 @@ GEM
rack-protection (= 3.2.0)
tilt (~> 2.0)
slack-notifier (2.4.0)
sqlite3 (1.7.3-aarch64-linux)
sqlite3 (1.7.3-arm-linux)
sqlite3 (1.7.3-arm64-darwin)
sqlite3 (1.7.3-x86-linux)
sqlite3 (1.7.3-x86_64-darwin)
sqlite3 (1.7.3-x86_64-linux)
sqlite3 (2.2.0-aarch64-linux-gnu)
sqlite3 (2.2.0-arm-linux-gnu)
sqlite3 (2.2.0-arm64-darwin)
sqlite3 (2.2.0-x86-linux-gnu)
sqlite3 (2.2.0-x86_64-darwin)
sqlite3 (2.2.0-x86_64-linux-gnu)
stringio (3.1.1)
sync (0.5.0)
term-ansicolor (1.11.2)
Expand Down Expand Up @@ -241,15 +244,15 @@ GEM
tilt (2.4.0)
timeout (0.4.1)
timers (4.3.5)
tins (1.35.0)
tins (1.37.0)
bigdecimal
sync
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
uglifier (4.2.1)
execjs (>= 0.3.0, < 3)
unicode-display_width (2.6.0)
webrick (1.8.2)
webrick (1.9.0)
websocket (1.2.11)
websocket-client-simple (0.6.1)
event_emitter
Expand All @@ -268,7 +271,7 @@ PLATFORMS
x86_64-linux

DEPENDENCIES
activerecord (~> 7.0)
activerecord (~> 7.2)
ansi (~> 1.5)
async (~> 1.32)
async-dns (~> 1.3)
Expand All @@ -279,15 +282,15 @@ DEPENDENCIES
erubis (~> 2.7)
espeak-ruby (~> 1.1.0)
eventmachine (~> 1.2, >= 1.2.7)
execjs (~> 2.9)
execjs (~> 2.10)
geckodriver-helper (~> 0.24.0)
irb (~> 1.14)
json
maxmind-db (~> 1.2)
mime-types (~> 3.6)
msfrpc-client (~> 1.1, >= 1.1.2)
net-smtp
otr-activerecord (~> 2.2.0)
otr-activerecord (~> 2.4.0)
parseconfig (~> 1.1, >= 1.1.2)
pry-byebug (~> 3.10, >= 3.10.1)
qr4r (~> 0.6.1)
Expand All @@ -297,13 +300,13 @@ DEPENDENCIES
rdoc (~> 6.7)
rest-client (~> 2.1.0)
rspec (~> 3.13)
rubocop (~> 1.66.1)
rubocop (~> 1.68.0)
rubyzip (~> 2.3)
rushover (~> 0.3.0)
selenium-webdriver (~> 4.25)
selenium-webdriver (~> 4.26)
sinatra (~> 3.2)
slack-notifier (~> 2.4)
sqlite3 (~> 1.4)
sqlite3 (~> 2.2)
term-ansicolor
test-unit-full (~> 0.0.5)
thin (~> 1.8)
Expand Down
5 changes: 3 additions & 2 deletions beef
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@ end

# Connect to DB
ActiveRecord::Base.logger = nil
OTR::ActiveRecord.migrations_paths = [File.join('core', 'main', 'ar-migrations')]
OTR::ActiveRecord.configure_from_hash!(adapter:'sqlite3', database:db_file)
# otr-activerecord require you to manually establish the connection with the following line
#Also a check to confirm that the correct Gem version is installed to require it, likely easier for old systems.
Expand All @@ -204,10 +203,12 @@ end

# Migrate (if required)
ActiveRecord::Migration.verbose = false # silence activerecord migration stdout messages
context = ActiveRecord::Migration.new.migration_context
ActiveRecord::Migrator.migrations_paths = [File.join('core', 'main', 'ar-migrations')]
context = ActiveRecord::MigrationContext.new(ActiveRecord::Migrator.migrations_paths)
if context.needs_migration?
ActiveRecord::Migrator.new(:up, context.migrations, context.schema_migration, context.internal_metadata).migrate
end

#
# @note Extensions may take a moment to load, thus we print out a please wait message
#
Expand Down
2 changes: 1 addition & 1 deletion core/filters/browser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def self.is_valid_browserversion?(str)
return false if has_non_printable_char?(str)
return true if str.eql? 'UNKNOWN'
return true if str.eql? 'ALL'
return false if !nums_only?(str) and !is_valid_float?(str)
return false if !nums_only?(str) and !str.match(/\A(0|[1-9][0-9]{0,3})(\.(0|[1-9][0-9]{0,3})){0,3}\z/)
return false if str.length > 20

true
Expand Down
Loading
Loading