rcmaehl / MSEdgeRedirect

A Tool to Redirect News, Search, Widgets, Weather and More to Your Default Browser
https://MSEdgeRedirect.com
GNU Lesser General Public License v3.0
3.96k stars 92 forks source link

URLs Rewritten in Managed Browser Environment? #270

Closed cgequi closed 1 year ago

cgequi commented 1 year ago

Preflight Checklist

Install Type

New Install

Install Mode

Active Mode

Steps to reproduce

Install MSEdgeRedirector. Set default browser to Firefox or Chrome. Use the Windows taskbar search box and enter a website name (i.e. amazon.com... don't even need the https://).

✔️ Expected Behavior

The website should open in the default browser. E.g., if I entered "amazon.com" in the Windows taskbar search and my default browser is Firefox, a new Firefox window should open at https://www.amazon.com.

❌ Actual Behavior

The default browser will open, but it will open with a URL as follows.

If the URL is not redirected, the browser will open a rewritten URL in the following format, assuming:

https://{website-name}/&timestamp={unix-epoc-timestamp}&source=WindowsSearchBox&oid={43-character_oid-string}&upn={email-address}

With Firefox, if you try to go to a website that gets redirected, the browser prompts with the following before opening:

Confirm. You are about to log into the site "{FQDN-from-email-address-in-URL}" with the username "{remainder-of-URL-except-FQDN-from-email-address}" but the website does not require authentication. This may be an attempt to trick you. Is "{FQDN-from-email-address-in-URL}" the site you want to visit? [ Yes | No ]

If "Yes" is selected, it will open the FQDN from the email address in the URL, not the URL itself.

Note that my browsers are managed by my employer, so this might not be a problem with MSEdgeRedirector itself.

But I'd love to know how to get this to stop. It has only started recently - and without an update to MSEdgeRedirector - so perhaps a GPO push or other management tooling has changed how Windows passes information from the taskbar search box to Edge and then on to MSEdgeRedirector...?

Note that if I uninstall MSEdgeRedir (and re-install Edge as the current bug requires me to do that), Edge will open {website-name} as expected.

Feel free to close this if it's not a bug with MSEdgeRedirector. But I'd love a pointer on where to look to figure out what's going on...

Microsoft Windows version

22H2 OS Build 22621.1702

Other Software

MSEdgeRedirector 0.7.3.0 in "Active" mode Firefox 113.0.2 (64-bit) Chrome 114.0.5735.110 (64-bit)

rcmaehl commented 1 year ago

Check %localappdata%\MSEdgeRedirect\logs\AppGeneral.log for Redirected Edge Call:

Is there a "UPN" listed? If not, the search bar didn't realize you were signed in (or you weren't previously signed in to the search bar)

If there is one, is it your email, or the FQDN? This is the one I'm guessing it is, especially if you've started any sort of Azure/Exchange online migration.

Looking into this regardless!

cgequi commented 1 year ago

Thank you for jumping right on this!

Strangely, AppGeneral.log doesn't have an entry since 5/26. However, AppFailures.log, AppSecurity.log, and URIFailures.log all have a few... just just a few. For the entries that are in AppGeneral.log from 5/26 and prior, they seem to all be of the format:

yyyy/mm/dd hh:mm:ss - Redirected Edge Call: --single-argument : launchContext1: Microsoft.Windows.Search_cw5n1h2txyewy url: {urlencoded-url}

I do not see a UPN listed in any of those logs.

Is there something I might have done to prevent the logs being written? Is something written to AppGeneral.log on every redirect, or just under certain circumstances?

Let me know how I can help. TY!

rcmaehl commented 1 year ago

they seem to all be of the format:

yyyy/mm/dd hh:mm:ss - Redirected Edge Call: --single-argument : launchContext1: Microsoft.Windows.Search_cw5n1h2txyewy url: {urlencoded-url}

Is there something I might have done to prevent the logs being written?

From being written to ANY log: Generally not, but some edge case might have the code ending up someone I didn't expect

Is something written to AppGeneral.log on every redirect, or just under certain circumstances?

Something should be written to any of the logs on every redirect.

Does the username firefox is displaying URL encoded at all?

cgequi commented 1 year ago

Interesting. Because I've been using MSEdgeRedirect nonstop since mid-February. I would guess, though, that the problems with the URLs being rewritten probably coincide with the end of the logging in AppGeneral.log. I'm not 100% sure about that, but I'm guessing that's probably the case.

Re:

Does the username firefox is displaying URL encoded at all?

No. The UPN in the URL that Firefox displays is in the format (using Amazon as an example and anonymizing the email):

https://www.amazon.com/&timestamp=1686066856915&source=WindowsSearchBox&oid=V_mqD3Dd3BHBcat8uWYJ3PkX7TecUnwyZ8zUAtdZkSE&upn=user.name@fqdn.tld

rcmaehl commented 1 year ago

More than likely hitting the Legacy Section of the code then. KB5017380 back in September changed the Edge Command line parameters. (https://github.com/rcmaehl/MSEdgeRedirect/issues/185#issuecomment-1263721887)

I kept the legacy section in case it ever changed back (and for people without the update yet). Let me throw in some logging and investigate further

cgequi commented 1 year ago

Sure. LMK what I can do to help. If you drop a new release with better logging that you want me to try, point me to that and I can install and provide feedback. Thanks again for being so on top of this!

Remzi1993 commented 1 year ago

@rcmaehl I just updated redirect to the latest version and if I search something in the searchbar nothing happens. Enter doesn't work and also clicking on open in browser doesn't work. Screenshot 2023-06-14 231907

cgequi commented 1 year ago

Downloaded the latest version of MSER (0.7.4.0) and the original issue appears to be resolved. I also do not have the issue that Remzi1993 has above. (Actually, that does happen occasionally, but that's whether MSER is installed or not. I think it's a problem with Explorer or Windows or Windows Search or whatever. Usually a restart fixes Remzi's problem for me.) I think you can close this one out. Thank you @rcmaehl for getting this fixed!

rcmaehl commented 1 year ago

Downloaded the latest version of MSER (0.7.4.0) and the original issue appears to be resolved. I also do not have the issue that Remzi1993 has above. (Actually, that does happen occasionally, but that's whether MSER is installed or not. I think it's a problem with Explorer or Windows or Windows Search or whatever. Usually a restart fixes Remzi's problem for me.) I think you can close this one out. Thank you @rcmaehl for getting this fixed!

Let me know if it reoccurs!

Some of the MSEdge calls were still using the legacy call parameters but not formatted as such. This should be fixed, although I'm sure some edge cases will still occur.