Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tor Browser
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
The Tor Project
Applications
Tor Browser
Commits
2de3c3e1
Verified
Commit
2de3c3e1
authored
May 17, 2021
by
Matthew Finkel
Committed by
ma1
Jul 26, 2023
Browse files
Options
Downloads
Patches
Plain Diff
Bug 40432: Prevent probing installed applications
Bugzilla:
https://bugzilla.mozilla.org/show_bug.cgi?id=1711084
parent
b294d2f2
No related branches found
No related tags found
1 merge request
!712
Bug 41908: Rebased on 102.14
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
uriloader/exthandler/nsExternalHelperAppService.cpp
+25
-5
25 additions, 5 deletions
uriloader/exthandler/nsExternalHelperAppService.cpp
with
25 additions
and
5 deletions
uriloader/exthandler/nsExternalHelperAppService.cpp
+
25
−
5
View file @
2de3c3e1
...
...
@@ -866,8 +866,33 @@ nsresult nsExternalHelperAppService::GetFileTokenForPath(
//////////////////////////////////////////////////////////////////////////////////////////////////////
// begin external protocol service default implementation...
//////////////////////////////////////////////////////////////////////////////////////////////////////
static
const
char
kExternalProtocolPrefPrefix
[]
=
"network.protocol-handler.external."
;
static
const
char
kExternalProtocolDefaultPref
[]
=
"network.protocol-handler.external-default"
;
NS_IMETHODIMP
nsExternalHelperAppService
::
ExternalProtocolHandlerExists
(
const
char
*
aProtocolScheme
,
bool
*
aHandlerExists
)
{
// Replicate the same check performed in LoadURI.
// Deny load if the prefs say to do so
nsAutoCString
externalPref
(
kExternalProtocolPrefPrefix
);
externalPref
+=
aProtocolScheme
;
bool
allowLoad
=
false
;
*
aHandlerExists
=
false
;
if
(
NS_FAILED
(
Preferences
::
GetBool
(
externalPref
.
get
(),
&
allowLoad
)))
{
// no scheme-specific value, check the default
if
(
NS_FAILED
(
Preferences
::
GetBool
(
kExternalProtocolDefaultPref
,
&
allowLoad
)))
{
return
NS_OK
;
// missing default pref
}
}
if
(
!
allowLoad
)
{
return
NS_OK
;
// explicitly denied
}
nsCOMPtr
<
nsIHandlerInfo
>
handlerInfo
;
nsresult
rv
=
GetProtocolHandlerInfo
(
nsDependentCString
(
aProtocolScheme
),
getter_AddRefs
(
handlerInfo
));
...
...
@@ -910,11 +935,6 @@ NS_IMETHODIMP nsExternalHelperAppService::IsExposedProtocol(
return
NS_OK
;
}
static
const
char
kExternalProtocolPrefPrefix
[]
=
"network.protocol-handler.external."
;
static
const
char
kExternalProtocolDefaultPref
[]
=
"network.protocol-handler.external-default"
;
// static
nsresult
nsExternalHelperAppService
::
EscapeURI
(
nsIURI
*
aURI
,
nsIURI
**
aResult
)
{
MOZ_ASSERT
(
aURI
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment