Closed
Bug 741874
Opened 13 years ago
Closed 13 years ago
[Security Review][Action Item]WebSMS - gaia code review
Categories
(mozilla.org :: Security Assurance, task)
Tracking
(Not tracked)
RESOLVED
DUPLICATE
of bug 754746
People
(Reporter: curtisk, Assigned: pauljt)
References
()
Details
(Whiteboard: [start 04/18/2012][target 05/02/2012])
Look at Gaia code - ensure dialer and sms can't be opened in an iframe maybe? Comes back to permissions model of B2G - gaia sms app author is vingtetun on IRC
Assignee | ||
Updated•13 years ago
|
Whiteboard: [start 04/18/2012][target 05/02/2012]
Assignee | ||
Comment 1•13 years ago
|
||
Started gaia testing, note that some of the b2g features are not finished yet (for example window.open and window.prototype dont behave properly for mozbrowser).
Also a lot depends on the permission model which isnt finalised yet. This may delay this review, just FYI.
Assignee | ||
Comment 2•13 years ago
|
||
Initial review complete, code still under development though.
Only real issue so far is the approach to sanitizing untrusted HTML. Current approach uses an ad hoc function:
function escapeHTML(str, escapeQuotes) {
var span = document.createElement('span');
span.textContent = str;
if (escapeQuotes)
return span.innerHTML.replace(/"/g, '"').replace(/'/g, ''');
return span.innerHTML;
}
Seems OK at first glance, but I can see this being error prone (for example, this will not help for any dynamically generated script content. Maybe this can be mitigated with content security policy.
Maybe just change adding a helper function might improve things, but its seems like something that could be leverage from elsewhere. e.g:
function escapeQuotedAttribute(str){
return escapeHTML(str,true);
}
Assignee | ||
Comment 3•13 years ago
|
||
Another potential misuse case escapeHTML(str, true) will only work when escaping a single quoted attribute. If used for a list of attributes or similar this would be a risk.
It would be better to come up with a specific library used across gaia apps to escape untrusted content. Maybe something already exists that can be used for this purpose.
Assignee | ||
Updated•13 years ago
|
Blocks: B2G-secreview
Assignee | ||
Updated•13 years ago
|
No longer blocks: B2G-secreview
Assignee | ||
Comment 4•13 years ago
|
||
Closing this bug to merge it with the other gaia code review bugs
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•