Closed Bug 13197 Opened 27 years ago Closed 27 years ago

Injecting JavaScript code in the bookmarks file, may be executed

Categories

(Core :: Security, defect, P3)

x86
Windows 95
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: joro, Assigned: mozilla)

References

()

Details

Mozilla build 1999090408 (and earlier builds) allows executing JS code in the "file" protocol by injecting code in the bookmarks file. The problem are SCRIPT tags in the TITLE tag. Demonstration and more info is available at: http://www.nat.bg/~joro/mozilla/bookm2.html
Since we wrote the bookmarks.html parser by hand, I _know_ that we won't be executing any JS when the file is parsed. How _exactly_ does the JS get run? From the description, it looks like you need to open the bookmarks file as a local HTML document, in which case, the normal content/chrome distinction needs to ensure that no evil JS can run. Yes, you can save _any_ URL as a bookmark (including "javascript:" URLs). However, that is a _good_ thing (e.g., bookmarklets a la 4.x). IMO, we need to fix the code that does the URL dispatching for bookmarks (which AFAIK is exactly the same as, e.g., the URL dispatching on an anchor tag).
Ok, I think I misunderstood the problem. Ignore my raving.
We should prevent <SCRIPT> from being saved in bookmark titles, descriptions, etc... that should plug the security hole.
Assignee: norris → rjc
Blocks: 12633
Yes, the same issue came up on 4.x (from Guninski as well) and I just made sure to escape the text that's saved so that the SCRIPT tag doesn't execute. We also need to make sure that JavaScript entities are quoted as well. See http://scopus.mcom.com/bugsplat/show_bug.cgi?id=351591 for the 4.x exploit.
Status: NEW → RESOLVED
Closed: 27 years ago
Resolution: --- → FIXED
Fixed.
verified fixed.
Status: RESOLVED → VERIFIED
Bulk moving all Browser Security bugs to new Security: General component. The previous Security component for Browser will be deleted.
Component: Security → Security: General
You need to log in before you can comment on or make changes to this bug.