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

Error opening launched browsers installed with alternative packages #7095

Open
1 task
jay-crnwll opened this issue Feb 19, 2022 · 15 comments
Open
1 task

Error opening launched browsers installed with alternative packages #7095

jay-crnwll opened this issue Feb 19, 2022 · 15 comments

Comments

@jay-crnwll
Copy link

jay-crnwll commented Feb 19, 2022

Describe the bug

The error message "The provided browser was not found" is returned when clicking on 'Launch Browser' in automated or manual scans. This looks to only occur when the web browser (in my case Firefox) was install through the Microsft Store in WIndows 11.

Steps to reproduce the behavior

  1. Remove any installed versions of FIrefox (or have a fresh install of Windows 11)
  2. Install Firefox from the Microsoft Store.
  3. Run Zaproxy.
  4. Enter a url in either the automated scan tab or manual tab.
  5. Click on 'Launch browser' button.
  6. The mentioned error message will/should appear.

Expected behavior

The relevant browser (i.e. Firefox or Chrome) should appear.

Software versions

Version 2.11.1

Screenshots

No response

Errors from the zap.log file

No response

Additional context

In my instance, uninstalling the browser and reinstalling it using the install app from the mozilla download page resolved this issue.

Would you like to help fix this issue?

  • Yes
@jay-crnwll jay-crnwll added the bug label Feb 19, 2022
@kingthorin
Copy link
Member

I’ll try to see if I can find a Win 11 VM to test this on.

@jay-crnwll
Copy link
Author

I'm assuming the geckodriver driver is looking for the firefox executable in "C:\Program Files\Mozilla Firefox" folder. But when Firefox is installed via the Microsoft store the exe is located somewhere else.

@thc202
Copy link
Member

thc202 commented Feb 19, 2022

The locations of the browser binaries can be specified in the options: https://www.zaproxy.org/docs/desktop/addons/selenium/options/

That geckodriver is not finding the binary is not really a ZAP issue (geckodriver checks the registry: https://firefox-source-docs.mozilla.org/testing/geckodriver/Flags.html#code-b-var-binary-var-code-code-binary-var-binary-var-code ).

@psiinon
Copy link
Member

psiinon commented Feb 19, 2022

@caladanjc where was Firefox installed?
We could potentially check this location on Windows as a special case...

@kingthorin
Copy link
Member

kingthorin commented Feb 19, 2022

Are you able to start Firefox from a command prompt or power shell? (Ex: is it in %path% ?)

Edit: When installed from the store.

@thc202
Copy link
Member

thc202 commented Feb 19, 2022

Better raise an issue with geckodriver rather than add workarounds in ZAP, IMO.

@jay-crnwll
Copy link
Author

My apologies, I thought the driver was created by Zap developers. I'll inform the relevant people(s).

In the meantime however, do you think it might be an idea to mention in the install process/steps that if any browsers that have been installed via Microsoft Store that it might not work as expected and that the user will/may need to use the direct install apps instead.....just an idea :-)

@psiinon
Copy link
Member

psiinon commented Feb 21, 2022

I'm always in favour for improving the docs :)
The existing help is https://www.zaproxy.org/docs/desktop/addons/selenium/options/
How do you think we could improve it?

@njmulsqb
Copy link
Contributor

I am facing this error with my Ubuntu 22.04, it throws this error straightaway when opening firefox via manual explore whereas chrome opens but it also closes after few minutes itself stating "provided browser not found"

OS: Ubuntu 22.04
Version: 2.11.1

@thc202 thc202 changed the title The provided browser was not found Error opening launched browsers installed with alternative packages May 15, 2022
@thc202
Copy link
Member

thc202 commented May 15, 2022

Tweaked the issue title to make it more generic. This is not an issue in ZAP but the WebDrivers which should cope with the browsers installed differently.

For geckodriver with snap that's mozilla/geckodriver#2010.

@njmulsqb
Copy link
Contributor

njmulsqb commented May 16, 2022

I am facing this error with my Ubuntu 22.04, it throws this error straightaway when opening firefox via manual explore whereas chrome opens but it also closes after few minutes itself stating "provided browser not found"

OS: Ubuntu 22.04 Version: 2.11.1

The issue is, Ubuntu now by default is using snap to install packages, even if you run sudo apt install chromium-browser it instead of fetching from apt repository, runs snap process in the backend.
Firefox is also installed via Snap, so ZAP is unable to run both of these on Ubuntu 22.04

@kingthorin
Copy link
Member

kingthorin commented May 17, 2022

I was finally able to test this on a Win 11 VM.

I was able to work around the issue by setting the path to the Firefox binary in ZAP's options:
C:\Program Files\WindowsApps\Mozilla.Firefox_100.0.1.0_x64__n80bbvh6b1yt2\VFS\ProgramFiles\Firefox Package Root\Firefox.exe it would be my guess that the middle part is not static/stable due to inclusion of version # and what I'm guessing is a profile ID or something 🤷 You can get the appropriate path by launching firefox and getting properties on one of it's threads.

image
image
Highlight and copy the whole "Location:" value. (You can set the insertion point somewhere on the line then use the home button then shift + end to highlight the whole thing, ctrl+c/ctrl+v to deal with it.)

@njmulsqb
Copy link
Contributor

image
I have provided locations for both chromium and firefox browser in selenium section but still its not working, currently I am unable to use both browsers in Zap on ubuntu. Any other workaround?

@thc202
Copy link
Member

thc202 commented Sep 20, 2022

You might need to use other paths when using snap, for Firefox it seems to be /snap/firefox/current/firefox.launcher (from geckodriver code).

@thc202
Copy link
Member

thc202 commented Sep 20, 2022

For the record, the referenced geckodriver issue was already addressed but not yet released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

5 participants