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
a5a793d9
Unverified
Commit
a5a793d9
authored
May 17, 2021
by
Matthew Finkel
Browse files
Options
Downloads
Patches
Plain Diff
Bug 40432: Prevent probing installed applications
parent
cf8458ca
Loading
Loading
No related merge requests found
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 @
a5a793d9
...
...
@@ -1002,8 +1002,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
));
...
...
@@ -1046,11 +1071,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"
;
NS_IMETHODIMP
nsExternalHelperAppService
::
LoadURI
(
nsIURI
*
aURI
,
nsIPrincipal
*
aTriggeringPrincipal
,
...
...
This diff is collapsed.
Click to expand it.
Matthew Finkel
@sysrqb
mentioned in merge request
!138 (merged)
·
Jun 3, 2021
mentioned in merge request
!138 (merged)
mentioned in merge request !138
Toggle commit list
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
register
or
sign in
to comment