why not sha checksum?
Posted Jul 2, 2009 23:20 UTC (Thu) by
socket (guest, #43)
In reply to:
why not sha checksum? by ccyoung
Parent article:
Mozilla's Content Security Policy
Think about this some. What are you taking the SHA sum of? The content of the page, of course. Say, for example, that the page in question is contains a number of user-entered comments, like this one on LWN you're reading. Those comments were probably stored in a database - a script pulls them out, and inserts them into the appropriate places of the page.
Your checksum won't tell you whether there's references to javascript in the content that's been sent to your browser. If the server didn't filter them properly, and your browser just does as its told (without giving you control over whether it should treat any individual portion as code or data) then your SHA sum will tell you that yes, indeed, the malicious code was malicious before it went into the comment system in the first place.
(
Log in to post comments)