Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
2ca129b9
Commit
2ca129b9
authored
Apr 13, 2015
by
Byron Jones
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 1031035: xmlrpc can be DoS'd with billion laughs attack
r=LpSolit,a=glob
parent
05c0a40a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
XMLRPC.pm
Bugzilla/WebService/Server/XMLRPC.pm
+8
-0
importxml.pl
importxml.pl
+3
-0
No files found.
Bugzilla/WebService/Server/XMLRPC.pm
View file @
2ca129b9
...
...
@@ -131,6 +131,14 @@ use Bugzilla::WebService::Constants qw(XMLRPC_CONTENT_TYPE_WHITELIST);
use
Bugzilla::WebService::
Util
qw(fix_credentials)
;
use
Scalar::
Util
qw(tainted)
;
sub
new
{
my
$self
=
shift
->
SUPER::
new
(
@_
);
# Initialise XML::Parser to not expand references to entities, to prevent DoS
require
XML::
Parser
;
$self
->
{
_parser
}
->
parser
(
parser
=>
XML::
Parser
->
new
(
NoExpand
=>
1
,
Handlers
=>
{
Default
=>
sub
{}
}
));
return
$self
;
}
sub
deserialize
{
my
$self
=
shift
;
...
...
importxml.pl
View file @
2ca129b9
...
...
@@ -1275,6 +1275,9 @@ my $twig = XML::Twig->new(
},
start_tag_handlers
=>
{
bugzilla
=>
\&
init
}
);
# Prevent DoS using the billion laughs attack.
$twig
->
{
NoExpand
}
=
1
;
$twig
->
parse
(
$xml
);
my
$root
=
$twig
->
root
;
my
$maintainer
=
$root
->
{
'att'
}
->
{
'maintainer'
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment