Closed
Bug 513593
Opened 16 years ago
Closed 16 years ago
The WebService should taint incoming parameters
Categories
(Bugzilla :: WebService, defect, P1)
Tracking
()
RESOLVED
FIXED
Bugzilla 3.6
People
(Reporter: mkanat, Assigned: mkanat)
References
Details
(Whiteboard: [es-ita][relnote that inval params are deleted and input is tainted])
Attachments
(1 file, 2 obsolete files)
|
4.78 KB,
patch
|
dkl
:
review+
|
Details | Diff | Splinter Review |
The WebService currently doesn't taint incoming parameters. This doesn't currently cause any security issues that I'm aware of, but we should still make it taint them. I suspect we'd have to pull in Taint::Util from CPAN or something like that in order to do this.
| Assignee | ||
Updated•16 years ago
|
Assignee: webservice → mkanat
Target Milestone: --- → Bugzilla 3.6
| Assignee | ||
Comment 1•16 years ago
|
||
Here's a work in progress. I still need to implement _taint_som.
| Assignee | ||
Comment 2•16 years ago
|
||
I'm going to mark this as a sec bug until we're certain that this isn't causing any security issues.
Group: bugzilla-security
| Assignee | ||
Comment 3•16 years ago
|
||
Without any testing of whether or not the actual tainting is causing any trouble, this taints all incoming WebService parameters.
I made Taint::Util required instead of optional because we can replace trick_taint with untaint(), if we have it.
Attachment #399268 -
Attachment is obsolete: true
| Assignee | ||
Comment 4•16 years ago
|
||
Comment on attachment 399361 [details] [diff] [review]
v1
Okay, I've tested this against the current WebService QA tests, and they all still pass, actually. I'm still investigating if there are any unfound security issues, but for now, we might as well review and check in this patch.
I'm asking dkl for review because, as I recall, he was the reviewer for the JSON-RPC stuff.
Attachment #399361 -
Flags: review?(dkl)
Attachment #399361 -
Flags: review?(LpSolit)
Comment 5•16 years ago
|
||
+ # We know that all hash keys passed in to the WebService will
+ # match \w+, so we delete any key that doesn't match that.
+ if ($key !~ /^\w+$/) {
+ delete $container->{$key};
We use - for some params, or are those mapped to something else for the webservices?
| Assignee | ||
Comment 6•16 years ago
|
||
(In reply to comment #5)
> We use - for some params, or are those mapped to something else for the
> webservices?
They're mapped, for sure, if we even have any of those remaining in our own code.
Comment 7•16 years ago
|
||
Yeah, doesn't look like we allow the boolean chart stuff (which was what I was thinking of)
Comment 8•16 years ago
|
||
Comment on attachment 399361 [details] [diff] [review]
v1
>Index: Bugzilla/Install/Requirements.pm
>+ module => 'Taint::Util',
>+ module => 'Data::Walk',
Why don't you use Test::Taint instead of both modules above? taint_deeply() seems to do what you want.
| Assignee | ||
Comment 9•16 years ago
|
||
(In reply to comment #8)
> Why don't you use Test::Taint instead of both modules above? taint_deeply()
> seems to do what you want.
Oh, I didn't know that. I figured it was just for tests. I'd still need a way to validate hash keys on a lower level than the main $params, though, so probably best to just stay with Data::Walk.
Comment 10•16 years ago
|
||
But Test::Taint offers test capabilities which may be useful for our own testing, which Taint::Util has not.
| Assignee | ||
Comment 11•16 years ago
|
||
There are no unfound security issues by my audit, and the other bugs are now public, so we can unlock this one.
Group: bugzilla-security
| Assignee | ||
Updated•16 years ago
|
Priority: -- → P1
Comment 12•16 years ago
|
||
Comment on attachment 399361 [details] [diff] [review]
v1
not ok 133 - Bugzilla/WebService/Util.pm --ERROR
# Failed test 'Bugzilla/WebService/Util.pm --ERROR'
# at t/001compile.t line 110.
Global symbol "$params" requires explicit package name at Bugzilla/WebService/Util.pm line 57.
Bugzilla/WebService/Util.pm had compilation errors.
not ok 134 - Bugzilla/WebService/Product.pm --ERROR
# Failed test 'Bugzilla/WebService/Product.pm --ERROR'
# at t/001compile.t line 110.
Global symbol "$params" requires explicit package name at Bugzilla/WebService/Util.pm line 57.
Compilation failed in require at Bugzilla/WebService/Product.pm line 24.
BEGIN failed--compilation aborted at Bugzilla/WebService/Product.pm line 24.
ok 135 - Bugzilla/WebService/Bugzilla.pm
ok 136 - Bugzilla/WebService/Server.pm
not ok 137 - Bugzilla/WebService/User.pm --ERROR
# Failed test 'Bugzilla/WebService/User.pm --ERROR'
# at t/001compile.t line 110.
Global symbol "$params" requires explicit package name at Bugzilla/WebService/Util.pm line 57.
Compilation failed in require at Bugzilla/WebService/User.pm line 31.
BEGIN failed--compilation aborted at Bugzilla/WebService/User.pm line 31.
not ok 138 - Bugzilla/WebService/Bug.pm --ERROR
# Failed test 'Bugzilla/WebService/Bug.pm --ERROR'
# at t/001compile.t line 110.
Global symbol "$params" requires explicit package name at Bugzilla/WebService/Util.pm line 57.
Compilation failed in require at Bugzilla/WebService/Bug.pm line 30.
BEGIN failed--compilation aborted at Bugzilla/WebService/Bug.pm line 30.
not ok 139 - Bugzilla/WebService/Server/JSONRPC.pm --ERROR
# Failed test 'Bugzilla/WebService/Server/JSONRPC.pm --ERROR'
# at t/001compile.t line 110.
Global symbol "$params" requires explicit package name at Bugzilla/WebService/Util.pm line 57.
Compilation failed in require at Bugzilla/WebService/Server/JSONRPC.pm line 29.
BEGIN failed--compilation aborted at Bugzilla/WebService/Server/JSONRPC.pm line 29.
not ok 140 - Bugzilla/WebService/Server/XMLRPC.pm --ERROR
# Failed test 'Bugzilla/WebService/Server/XMLRPC.pm --ERROR'
# at t/001compile.t line 110.
Global symbol "$params" requires explicit package name at Bugzilla/WebService/Util.pm line 57.
Compilation failed in require at Bugzilla/WebService/Server/XMLRPC.pm line 145.
BEGIN failed--compilation aborted at Bugzilla/WebService/Server/XMLRPC.pm line 145.
Attachment #399361 -
Flags: review?(dkl) → review-
Updated•16 years ago
|
Attachment #399361 -
Flags: review?(LpSolit)
| Assignee | ||
Comment 13•16 years ago
|
||
Okay, this version compiles, and I switched to using Test::Taint since it's only one module that we have to require, that way.
Attachment #399361 -
Attachment is obsolete: true
Attachment #405005 -
Flags: review?(dkl)
| Assignee | ||
Updated•16 years ago
|
Attachment #405005 -
Flags: review?(dkl) → review?(LpSolit)
| Assignee | ||
Updated•16 years ago
|
Whiteboard: [es-ita]
Comment 14•16 years ago
|
||
I have tested this and works for me. r=dkl
| Assignee | ||
Comment 15•16 years ago
|
||
Comment on attachment 405005 [details] [diff] [review]
v2
Hey, great. Could you just grant r+? I only need one r+ for this.
Attachment #405005 -
Flags: review?(LpSolit) → review?(dkl)
Comment 16•16 years ago
|
||
Comment on attachment 405005 [details] [diff] [review]
v2
r=dkl
Attachment #405005 -
Flags: review?(dkl) → review+
Updated•16 years ago
|
Flags: approval?
| Assignee | ||
Updated•16 years ago
|
Flags: approval? → approval+
| Assignee | ||
Comment 17•16 years ago
|
||
Checking in Bugzilla/Install/Requirements.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Install/Requirements.pm,v <-- Requirements.pm
new revision: 1.73; previous revision: 1.72
done
Checking in Bugzilla/WebService/Util.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/WebService/Util.pm,v <-- Util.pm
new revision: 1.4; previous revision: 1.3
done
Checking in Bugzilla/WebService/Server/JSONRPC.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/WebService/Server/JSONRPC.pm,v <-- JSONRPC.pm
new revision: 1.2; previous revision: 1.1
done
Checking in Bugzilla/WebService/Server/XMLRPC.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/WebService/Server/XMLRPC.pm,v <-- XMLRPC.pm
new revision: 1.7; previous revision: 1.6
done
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
| Assignee | ||
Updated•16 years ago
|
Keywords: relnote
Whiteboard: [es-ita] → [es-ita][relnote that inval params are deleted and input is tainted]
You need to log in
before you can comment on or make changes to this bug.
Description
•