Closed Bug 1242961 Opened 9 years ago Closed 9 years ago

nsStandardURL still allows to build valid nsIURIs longer than network.standard-url.max-length

Categories

(Core :: Networking, defect)

39 Branch
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla47
Tracking Status
firefox47 --- fixed

People

(Reporter: mak, Assigned: mak)

References

Details

(Keywords: regression)

Attachments

(1 file)

How I reached this point is explained in https://bugzilla.mozilla.org/show_bug.cgi?id=1240013#c6 Here is a sum up: After bug 1135354 it should not be possible to build an nsIURI longer than net_GetURLMaxLength(). Unfortunately the patch in bug 1135354 addressed the SetSpec case and other cases going through SetSpec, but not the other cases that allow to build a valid nsIURI and then transform it into an invalid one. For example replacing the ref with a huge one. This is a problem when some code assumes a spec from an nsIURI should always allow to rebuild a valid nsIURI. I think I can try to make a patch.
Looks like the following APIs are unsafe regarding the spec length check, since they directly manipulate mSpec: nsStandardURL::SetScheme nsStandardURL::SetUserPass nsStandardURL::SetUsername nsStandardURL::SetPassword nsStandardURL::SetHost nsStandardURL::SetPort nsStandardURL::SetQuery nsStandardURL::SetRef nsStandardURL::SetFileName nsStandardURL::Read
Comment on attachment 8713188 [details] MozReview Request: Bug 1242961 - nsStandardURL still allows to build valid nsIURIs longer than network.standard-url.max-length. r=valentin https://reviewboard.mozilla.org/r/32763/#review29595 This looks great! Thanks for adding unit tests.
Attachment #8713188 - Flags: review?(valentin.gosu) → review+
Flags: in-testsuite+
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla47
Version: unspecified → 39 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: