Changeset 29174 in webkit
- Timestamp:
- Jan 4, 2008, 1:02:16 PM (17 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r29170 r29174 1 2008-01-04 Timothy Hatcher <timothy@apple.com> 2 3 Reviewed by Darin Adler. 4 5 <rdar://problem/5604409> JavaScript privilege escalation when Web Inspector accesses page unsafely (16011) 6 7 Check if the property is a getter before asking for the value. 8 If the property is a getter, we no longer show the value. 9 10 * page/inspector/PropertiesSidebarPane.js: 11 * page/inspector/inspector.css: 12 1 13 2008-01-04 Dan Bernstein <mitz@apple.com> 2 14 -
trunk/WebCore/page/inspector/PropertiesSidebarPane.js
r27883 r29174 83 83 WebInspector.ObjectPropertiesSection.prototype.__proto__ = WebInspector.PropertiesSection.prototype; 84 84 85 WebInspector.ObjectPropertyTreeElement = function( object, propertyName)85 WebInspector.ObjectPropertyTreeElement = function(parentObject, propertyName) 86 86 { 87 this.parentObject = parentObject; 88 this.propertyName = propertyName; 89 90 var childObject = this.safePropertyValue(parentObject, propertyName); 91 var isGetter = parentObject.__lookupGetter__(propertyName); 92 87 93 var title = "<span class=\"name\">" + propertyName.escapeHTML() + "</span>: "; 88 title += "<span class=\"value\">" + Object.describe(object[propertyName], true).escapeHTML() + "</span>"; 94 if (!isGetter) 95 title += "<span class=\"value\">" + Object.describe(childObject, true).escapeHTML() + "</span>"; 96 else 97 // FIXME: this should show something like "getter" once we can change localization (bug 16734). 98 title += "<span class=\"value dimmed\">—</span>"; 89 99 90 100 var hasSubProperties = false; 91 var type = typeof object[propertyName];92 if ( object[propertyName]&& (type === "object" || type === "function")) {93 for (subPropertyName in object[propertyName]) {101 var type = typeof childObject; 102 if (childObject && (type === "object" || type === "function")) { 103 for (subPropertyName in childObject) { 94 104 if (subPropertyName === "__treeElementIdentifier") 95 105 continue; … … 99 109 } 100 110 101 this.object = object;102 this.propertyName = propertyName;103 104 111 TreeElement.call(this, title, null, hasSubProperties); 105 112 } 106 113 107 114 WebInspector.ObjectPropertyTreeElement.prototype = { 115 safePropertyValue: function(object, propertyName) 116 { 117 var getter = object.__lookupGetter__(propertyName); 118 if (getter) 119 return; 120 return object[propertyName]; 121 }, 122 108 123 onpopulate: function() 109 124 { … … 111 126 return; 112 127 113 var object = this.object[this.propertyName];114 var properties = Object.sortedProperties( object);128 var childObject = this.safePropertyValue(this.parentObject, this.propertyName); 129 var properties = Object.sortedProperties(childObject); 115 130 for (var i = 0; i < properties.length; ++i) { 116 131 var propertyName = properties[i]; 117 132 if (propertyName === "__treeElementIdentifier") 118 133 continue; 119 this.appendChild(new WebInspector.ObjectPropertyTreeElement( object, propertyName));134 this.appendChild(new WebInspector.ObjectPropertyTreeElement(childObject, propertyName)); 120 135 } 121 136 } -
trunk/WebCore/page/inspector/inspector.css
r28918 r29174 1190 1190 margin-top: 0; 1191 1191 padding-right: 2px; 1192 -webkit-user-select: none; 1192 1193 } 1193 1194 … … 1235 1236 } 1236 1237 1238 .section .properties .value.dimmed { 1239 color: rgb(100, 100, 100); 1240 } 1241 1237 1242 .section .properties .number { 1238 1243 color: blue; … … 1455 1460 vertical-align: middle; 1456 1461 opacity: 0.75; 1462 -webkit-user-select: none; 1457 1463 } 1458 1464 … … 1470 1476 left: 5px; 1471 1477 top: 2px; 1478 -webkit-user-select: none; 1472 1479 } 1473 1480 … … 1477 1484 left: 4px; 1478 1485 top: 2px; 1486 -webkit-user-select: none; 1479 1487 } 1480 1488 … … 1492 1500 left: 8px; 1493 1501 top: 1px; 1502 -webkit-user-select: none; 1494 1503 } 1495 1504
Note:
See TracChangeset
for help on using the changeset viewer.