WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
57035
Web Inspector: render XHRs matching JSON regex as JSON.
https://bugs.webkit.org/show_bug.cgi?id=57035
Summary
Web Inspector: render XHRs matching JSON regex as JSON.
Pavel Feldman
Reported
2011-03-24 10:28:27 PDT
Patch to follow.
Attachments
[IMAGE] Screenshot with patch applied.
(150.55 KB, image/png)
2011-03-24 10:30 PDT
,
Pavel Feldman
no flags
Details
Patch
(12.57 KB, patch)
2011-03-24 10:38 PDT
,
Pavel Feldman
yurys
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Pavel Feldman
Comment 1
2011-03-24 10:30:12 PDT
Created
attachment 86794
[details]
[IMAGE] Screenshot with patch applied.
Pavel Feldman
Comment 2
2011-03-24 10:38:29 PDT
Created
attachment 86798
[details]
Patch
Yury Semikhatsky
Comment 3
2011-03-24 10:59:34 PDT
Comment on
attachment 86798
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=86798&action=review
> Source/WebCore/inspector/front-end/RemoteObject.js:219 > + buffer += ", ";
Why not use Array.join instead?
> Source/WebCore/inspector/front-end/ResourceJSONView.js:41 > + var start = /[{[]/.exec(text);
I vaguely recall that it's not uncommon to use a sequence of all kinds of brackets instead of while(1) to prevent XSS in this case. I don't remember details though and in particular whether the brackets should be opening or closing ones, you may want to double check.
> Source/WebCore/inspector/front-end/ResourceJSONView.js:42 > + if (start && start.index)
Can it be a valid JSON string if it doesn't contain no { nor [ ?
Pavel Feldman
Comment 4
2011-03-24 11:01:57 PDT
> I vaguely recall that it's not uncommon to use a sequence of all kinds of brackets instead of while(1) to prevent XSS in this case. I don't remember details though and in particular whether the brackets should be opening or closing ones, you may want to double check.
I did check, they prepend closing brackets.
> > Source/WebCore/inspector/front-end/ResourceJSONView.js:42 > > + if (start && start.index) > > Can it be a valid JSON string if it doesn't contain no { nor [ ?
Sure, it can be a string or a number.
Pavel Feldman
Comment 5
2011-03-24 11:11:41 PDT
Committed
r81878
: <
http://trac.webkit.org/changeset/81878
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug