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

Merged
merged 55 commits into from
Nov 6, 2024

Conversation

zinduolis
Copy link
Collaborator

This reverts commit 074efc7 that reverted the merge of #3149

Pull Request

Thanks for submitting a PR! Please fill in this template where appropriate:

Category

Bug

Feature/Issue Description

Q: Please give a brief summary of your feature/fix
A: Fix invalid browser version and plugins messages (#3051)

Q: Give a technical rundown of what you have changed (if applicable)
A: Updated conditions checking for valid browser version. Also added message for situation when plugins are not detected (e. g. for mobile browsers). Added https://github.com/bowser-js/bowser and extended Chrome, Firefox and Opera browser name recognition.

Test Cases

Q: Describe your test cases, what you have covered and if there are any use cases that still need addressing.
A: Successfully ran bundle exec rake, had print_info in the browser.rb file to confirm the values when hooking Firefox, Chrome, Opera and Android Chrome. Also, executed all the debug modules with these 3 browser types without any errors on beef side.

Wiki Page

If you are adding a new feature that is not easily understood without context, please draft a section to be added to the Wiki below.

@zinduolis zinduolis mentioned this pull request Oct 26, 2024
dependabot bot and others added 2 commits October 27, 2024 22:03
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.66.1 to 1.67.0.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](rubocop/rubocop@v1.66.1...v1.67.0)

---
updated-dependencies:
- dependency-name: rubocop
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
@zinduolis zinduolis temporarily deployed to Integrate Pull Request October 28, 2024 11:13 — with GitHub Actions Inactive
@zinduolis zinduolis temporarily deployed to Integrate Pull Request October 29, 2024 10:32 — with GitHub Actions Inactive
@zinduolis
Copy link
Collaborator Author

Hey @stephenakq , I have hardened the regex.

This is what Claude has to say about it with regard to vulnerabilities:

  1. ReDoS Risk: Low
^(0|[1-9][0-9]{0,3})(\.(0|[1-9][0-9]{0,3})){0,3}$

Properties that make it safe:

  • Uses fixed-width ranges with {0,3}
  • No nested quantifiers or alternations that could cause backtracking ambiguity
  • No unbounded repetition (* or +)
  • Clear, unambiguous pattern boundaries with fixed repeater {0,3}
  1. Time Complexity: O(n)
  • Linear-time matching
  • Each character is processed exactly once
  • No backtracking scenarios that could cause exponential time growth
  1. Memory & Input Size:
    Maximum possible input:
  • First number: 4 digits (9999)
  • Up to 3 additional segments: each 4 digits
  • Dots between segments
  • Total max: 4 + (3 × (1 + 4)) = 19 characters
  1. Test with pathological inputs:
"9999.9999.9999.9999"    // Maximum valid - processes quickly
"9999.9999.9999.9999X"   // Invalid char - fails fast
"9999.9999.9999.9999.1"  // Extra segment - fails fast
".........."             // Invalid format - fails fast
"a".repeat(1000)         // Long invalid - fails immediately
  1. Edge Cases Handled:
  • Prevents leading zeros in each number segment
  • Clear start/end boundaries with ^ and $
  • Explicit handling of zero vs non-zero starts

Assessment: This is a well-designed, safe regex pattern. It avoids common regex vulnerabilities through:

  • Bounded repetition
  • No ambiguous patterns
  • No catastrophic backtracking possibilities
  • Natural input length limitations

zinduolis and others added 19 commits October 30, 2024 14:16
…er/rubocop-1.67.0

Bump rubocop from 1.66.1 to 1.67.0
Bumps [rack](https://github.com/rack/rack) from 2.2.9 to 2.2.10.
- [Release notes](https://github.com/rack/rack/releases)
- [Changelog](https://github.com/rack/rack/blob/main/CHANGELOG.md)
- [Commits](rack/rack@v2.2.9...v2.2.10)

---
updated-dependencies:
- dependency-name: rack
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
…er/rack-2.2.10

Bump rack from 2.2.9 to 2.2.10
Bumps [rexml](https://github.com/ruby/rexml) from 3.3.8 to 3.3.9.
- [Release notes](https://github.com/ruby/rexml/releases)
- [Changelog](https://github.com/ruby/rexml/blob/master/NEWS.md)
- [Commits](ruby/rexml@v3.3.8...v3.3.9)

---
updated-dependencies:
- dependency-name: rexml
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
…er/rexml-3.3.9

Bump rexml from 3.3.8 to 3.3.9
Bumps [json](https://github.com/ruby/json) from 2.7.2 to 2.7.4.
- [Release notes](https://github.com/ruby/json/releases)
- [Changelog](https://github.com/ruby/json/blob/master/CHANGES.md)
- [Commits](ruby/json@v2.7.2...v2.7.4)

---
updated-dependencies:
- dependency-name: json
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
…er/json-2.7.4

Bump json from 2.7.2 to 2.7.4
Bumps [execjs](https://github.com/rails/execjs) from 2.9.1 to 2.10.0.
- [Release notes](https://github.com/rails/execjs/releases)
- [Commits](rails/execjs@v2.9.1...v2.10.0)

---
updated-dependencies:
- dependency-name: execjs
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
…er/execjs-2.10.0

Bump execjs from 2.9.1 to 2.10.0
Bumps [otr-activerecord](https://github.com/jhollinger/otr-activerecord) from 2.2.0 to 2.4.0.
- [Changelog](https://github.com/jhollinger/otr-activerecord/blob/main/CHANGELOG.md)
- [Commits](jhollinger/otr-activerecord@v2.2.0...v2.4.0)

---
updated-dependencies:
- dependency-name: otr-activerecord
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
…er/otr-activerecord-2.4.0

Bump otr-activerecord from 2.2.0 to 2.4.0
Bumps [selenium-webdriver](https://github.com/SeleniumHQ/selenium) from 4.25.0 to 4.26.0.
- [Release notes](https://github.com/SeleniumHQ/selenium/releases)
- [Changelog](https://github.com/SeleniumHQ/selenium/blob/trunk/rb/CHANGES)
- [Commits](SeleniumHQ/selenium@selenium-4.25.0...selenium-4.26.0)

---
updated-dependencies:
- dependency-name: selenium-webdriver
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
…er/selenium-webdriver-4.26.0

Bump selenium-webdriver from 4.25.0 to 4.26.0
Bumps [json](https://github.com/ruby/json) from 2.7.4 to 2.7.5.
- [Release notes](https://github.com/ruby/json/releases)
- [Changelog](https://github.com/ruby/json/blob/master/CHANGES.md)
- [Commits](ruby/json@v2.7.4...v2.7.5)

---
updated-dependencies:
- dependency-name: json
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
…er/json-2.7.5

Bump json from 2.7.4 to 2.7.5
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.67.0 to 1.68.0.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](rubocop/rubocop@v1.67.0...v1.68.0)

---
updated-dependencies:
- dependency-name: rubocop
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
…er/rubocop-1.68.0

Bump rubocop from 1.67.0 to 1.68.0
zinduolis and others added 26 commits November 5, 2024 20:09
Update GitHub workflow for Browserstack testing
…de_to_7_2

Upgrade activerecord to 7.2 and refactor code for new version
Bumps [sqlite3](https://github.com/sparklemotion/sqlite3-ruby) from 1.7.3 to 2.2.0.
- [Release notes](https://github.com/sparklemotion/sqlite3-ruby/releases)
- [Changelog](https://github.com/sparklemotion/sqlite3-ruby/blob/main/CHANGELOG.md)
- [Commits](sparklemotion/sqlite3-ruby@v1.7.3...v2.2.0)

---
updated-dependencies:
- dependency-name: sqlite3
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
…er/sqlite3-2.2.0

Bump sqlite3 from 1.7.3 to 2.2.0
Bumps [json](https://github.com/ruby/json) from 2.7.5 to 2.7.6.
- [Release notes](https://github.com/ruby/json/releases)
- [Changelog](https://github.com/ruby/json/blob/master/CHANGES.md)
- [Commits](ruby/json@v2.7.5...v2.7.6)

---
updated-dependencies:
- dependency-name: json
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
…er/json-2.7.6

Bump json from 2.7.5 to 2.7.6
@zinduolis
Copy link
Collaborator Author

Hey @stephenakq, I have rebased it with master and it's now passing Browserstack tests. I'll be merging it tomorrow.

@zinduolis zinduolis merged commit f6d0115 into beefproject:master Nov 6, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant