fix(security): address multiple security vulnerabilities across codebase#14570
Merged
christian-bromann merged 13 commits intomainfrom Jul 16, 2025
Merged
fix(security): address multiple security vulnerabilities across codebase#14570christian-bromann merged 13 commits intomainfrom
christian-bromann merged 13 commits intomainfrom
Conversation
create-wdio
eslint-plugin-wdio
@wdio/allure-reporter
@wdio/appium-service
@wdio/browser-runner
@wdio/browserstack-service
@wdio/cli
@wdio/concise-reporter
@wdio/config
@wdio/cucumber-framework
@wdio/dot-reporter
@wdio/firefox-profile-service
@wdio/globals
@wdio/jasmine-framework
@wdio/json-reporter
@wdio/junit-reporter
@wdio/lighthouse-service
@wdio/local-runner
@wdio/logger
@wdio/mocha-framework
@wdio/protocols
@wdio/repl
@wdio/reporter
@wdio/runner
@wdio/sauce-service
@wdio/shared-store-service
@wdio/smoke-test-cjs-service
@wdio/smoke-test-reporter
@wdio/smoke-test-service
@wdio/spec-reporter
@wdio/static-server-service
@wdio/sumologic-reporter
@wdio/testingbot-service
@wdio/types
@wdio/utils
@wdio/webdriver-mock-service
webdriver
webdriverio
commit: |
bd10a24 to
dd8ed95
Compare
…ter sanitization Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…ter sanitization Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…ter sanitization Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR addresses several security vulnerabilities identified through static analysis, implementing comprehensive fixes across multiple packages to strengthen WebdriverIO's security posture.
📋 Summary of Fixes
14 files modified with security improvements across the following categories:
🛡️ Detailed Fixes
ReDoS Prevention
packages/wdio-logger/src/utils.ts: Added validation for user-provided regex patterns to prevent exponential backtrackingpackages/wdio-json-reporter/src/mergeResults.ts: Implemented safe file pattern validation with fallback to secure defaultspackages/wdio-utils/src/utils.ts: Fixed catastrophic backtracking in function detection regexpackages/webdriverio/src/commands/element/getHTML.ts: Optimized HTML comment removal regexCommand Injection Prevention
packages/wdio-utils/src/node/utils.ts:execSyncwithspawnSyncfor Chrome version detectionexecSyncwithspawnSyncfor Firefox version detectioninfra/compiler/src/plugins.ts: Converted TypeScript compilation from shell command to direct process executionPrototype Pollution Protection
packages/wdio-browserstack-service/src/util.ts: Added key validation inmergeDeep()to prevent__proto__,constructor, andprototypepollutionDirectory Traversal Protection
scripts/bidi/downloadSpec.ts: Implemented comprehensive zip entry path validation to prevent zip slip attacksEnhanced Sanitization
packages/wdio-browserstack-service/src/ai-handler.ts: Improved string escaping for JavaScript execution contextspackages/wdio-cucumber-framework/src/utils.ts: Enhanced regex escaping for Cucumber tag expressionspackages/wdio-cli/src/constants.ts: Fixed hostname validation for LambdaTest domainspackages/webdriver/src/utils.ts: Fixed hostname validation for SauceLabs domainspackages/wdio-browserstack-service/src/util.ts: Fixed hostname validation for BrowserStack domainspackages/wdio-mocha-framework/src/common.ts: Replaced regex with safer string methods for module path parsingCharacter Range Fixes
packages/webdriverio/src/utils/findStrategy.ts: Fixed regex character class[a-zA-z]to[a-zA-Z]to prevent unintended character matching🧪 Security Testing
All fixes have been designed to:
🎯 Impact
These fixes address potential security vectors including:
🔍 Validation Methods Used
No breaking changes - All modifications maintain API compatibility while significantly improving security posture.