Closed
Bug 607832
Opened 14 years ago
Closed 12 years ago
Ask Adobe to use SetDllDirectory instead of SetCurrentDirectory before loading their DLLs for the Shockwave plugin
Categories
(Plugins Graveyard :: Shockwave (Adobe), defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: ehsan.akhgari, Assigned: bbondy)
References
Details
(Keywords: sec-want, Whiteboard: [sg:want][adv-main24-] blocks our deployment of a fix for a critical bug)
Attachments
(1 file)
4.96 KB,
patch
|
ehsan.akhgari
:
review+
|
Details | Diff | Splinter Review |
Our fix for bug 286382 broke the Shockwave plugin (bug 607482). This happens because the plugin tries to load some DLLs from a different directory, and to make it work, it uses SetCurrentDirectory.
We should contact Adobe and ask them to switch to using SetDllDirectory instead, so that we don't have to hack around this in our code.
Reporter | ||
Comment 1•14 years ago
|
||
Comment 2•14 years ago
|
||
Kev: do we have any contacts with the Shockwave (not Flash) team we can work with on this one?
Assignee: nobody → kev
Whiteboard: [sg:nse] blocks our deployment of a fix for a critical bug
Updated•14 years ago
|
Whiteboard: [sg:nse] blocks our deployment of a fix for a critical bug → [sg:want] blocks our deployment of a fix for a critical bug
Comment 3•14 years ago
|
||
I am sure we can get them through the Flash team. Reaching out.
Updated•12 years ago
|
Assignee: kev → jeclark
OS: Mac OS X → Windows 7
Comment 4•12 years ago
|
||
I've passed a copy of this bug along to the Shockwave Player team, and have asked them to provide a couple named contacts to CC on this bug.
Comment 5•12 years ago
|
||
Latest version of Shockwave Player is already having the changes to use SetDllDirectory. I guess this change is added somewhere in Jan-2011.
Shockwave Player also has backward compatibility player module to take care of older shockwave content. And this module is not yet updated with the changes. Do you want us to update this module also immediately?
Comment 6•12 years ago
|
||
Ehsan, thoughts? Also, does this need to remain private?
Flags: needinfo?(ehsan)
Comment 7•12 years ago
|
||
https://bugzilla.mozilla.org/show_bug.cgi?id=603679
This was one of the related bug shared to us by Kev on November 09, 2010; probably related to this bug.
Reporter | ||
Comment 8•12 years ago
|
||
(In reply to Shyama Praveena S from comment #5)
> Latest version of Shockwave Player is already having the changes to use
> SetDllDirectory. I guess this change is added somewhere in Jan-2011.
> Shockwave Player also has backward compatibility player module to take care
> of older shockwave content. And this module is not yet updated with the
> changes. Do you want us to update this module also immediately?
That would be great, yes.
One other issue is how we can differentiate between the versions of Shockwave Flash which have this version versus the ones that don't. Our current hack implemented in bug 603679 is based on the name of the DLL file which seems not sufficient here...
(In reply to Benjamin Smedberg [:bsmedberg] from comment #6)
> Ehsan, thoughts? Also, does this need to remain private?
Yes, since it's possible to inject code in Firefox with a DLL named similarly to Shockwave's.
Flags: needinfo?(ehsan)
Comment 9•12 years ago
|
||
As per the bug https://bugzilla.mozilla.org/show_bug.cgi?id=286382
The discussion focuses on not to use LoadLibrary with partial paths and then rely on the OS search paths for the dll to get loaded. Instead compose the full path and pass it to LoadLibrary to load the intended dll.
Is this sufficient if Shockwave is updated to pass full/absolute path info to LoadLibrary calls?
Comment 10•12 years ago
|
||
Yes, if you are using full paths then not setting the current directory won't have any effect and we can apply our SetDllDirectory patch.
Updated•12 years ago
|
Assignee: jeclark → shyama
Comment 11•12 years ago
|
||
We will do the suggested changes and target it for the next release of shockwave.
Comment 12•12 years ago
|
||
@Ehsan Akhgari:
To determine Shockwave plugin version the File Version field of the dll, np32dswXXXXXXXX.dll can be used. Depending on the type of install or the source from where the installation happens the dll sometimes gets a suffix added in XXXX field (usually the version number). It will be something like np32dsw_1169620.dll.
So something like "name of the dll begining with np32dsw" can be used to get the dll. Currently the latest release version is 12.0.0.112.
If the shockwave patch is removed there might be machines with older version of shockwave already installed and the plugin will fail to load. For this case, is it possible to add a check like, if the vulnerable version of Shockwave is found do not load the plugin and ask the user to update shockwave plugin to the latest version?
Reporter | ||
Comment 13•12 years ago
|
||
(In reply to Shyama Praveena S from comment #12)
> @Ehsan Akhgari:
> To determine Shockwave plugin version the File Version field of the dll,
> np32dswXXXXXXXX.dll can be used. Depending on the type of install or the
> source from where the installation happens the dll sometimes gets a suffix
> added in XXXX field (usually the version number). It will be something like
> np32dsw_1169620.dll.
> So something like "name of the dll begining with np32dsw" can be used to get
> the dll. Currently the latest release version is 12.0.0.112.
Thanks!
> If the shockwave patch is removed there might be machines with older version
> of shockwave already installed and the plugin will fail to load. For this
> case, is it possible to add a check like, if the vulnerable version of
> Shockwave is found do not load the plugin and ask the user to update
> shockwave plugin to the latest version?
I don't think that we can remove the workaround code completely for now, but we will need to do the version check you mentioned above then this bug is fixed to disable the workaround for versions of Shockwave which have this problem fixed.
Comment 14•12 years ago
|
||
Thank you.
We are working on the changes to be done. As said before, targeting for the next release of shockwave.
I think once we are live with our changes we will confirm the new version where the fix is available. Post that you can go ahead with your changes.
For the version check (on shockwave) to apply your workaround the DLL path can be picked up from the registry which will have the accurate DLL path. Shockwave registers np32dsw DLL at [HKLM "SOFTWARE\MozillaPlugins\@adobe.com/ShockwavePlayer" "Path" "$INSTDIR\Director\np32dsw_$VVVVVV.dll"]
Comment 15•12 years ago
|
||
We have our next release of Shockwave version 12.0.2.122 on April 9th. And in this release we have added the necessary changes to use SetDllDirectory as discussed earlier.
You may use this version value for applying your patch fix for all older version of Shockwave alone.
Kindly let us know when you are applying the SetDllDirectory patch on Shockwave in webkit sources.
Reporter | ||
Comment 16•12 years ago
|
||
Brian, do you have the bandwidth to write the patch here? I'm afraid that I won't in the near future. Thanks!
Flags: needinfo?(netzen)
Assignee | ||
Comment 17•12 years ago
|
||
Sure, I'll try to take it at some point during v23 living on Nightly.
Flags: needinfo?(netzen)
Assignee | ||
Comment 18•12 years ago
|
||
Hey Ehsan,
Sorry I'm just getting around to this now, was hoping to get to it sooner.
Did you want this code reverted?
> int wmain(int argc, WCHAR **argv)
> {
> #ifndef XRE_DONT_PROTECT_DLL_LOAD
> mozilla::SanitizeEnvironmentVariables();
> *** SetDllDirectoryW(L"");
> #endif
This code gets executed for firefox, does it also for plugin container?
Do we only want to not call it under some conditions?
Don't we want to keep this code so that we don't accidentally load the wrong dll from the current path?
Maybe I just don't understand what needs to be done here.
From Comment 14 it looks like we want to only set the dll directory conditional on the value of the version in the np32dsw_1202122.dll file (path read from HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\MozillaPlugins\@adobe.com/ShockwavePlayer).
12.0.2.122 is the current version of shockwave I just downloaded and installed.
(In reply to Shyama Praveena S from comment #15)
> Kindly let us know when you are applying the SetDllDirectory patch on Shockwave in webkit sources.
I think you mean Gecko, or else maybe this message was meant for somewhere else.
Flags: needinfo?(ehsan)
Reporter | ||
Comment 19•12 years ago
|
||
Look at the patch for bug 603679. In that bug, we added conditional code to not call this SetDllDirectory("") in the plugin-container when loading Shockwave. What we want to do here is to lift that restriction for newer Shockwave plugin versions (see the earlier discussion in this bug.) Does that make sense?
Flags: needinfo?(ehsan)
Assignee | ||
Comment 20•12 years ago
|
||
OK thanks that makes sense, as I re-read this bug I missed Comment 1 correcting the bug id.
It seems like this code is already not being hit though because it searches for np32dsw.dll and the new DLL name is: np32dsw_1202122.dll
Should I change the code to always read from:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\MozillaPlugins\@adobe.com/ShockwavePlayer
Path value?
Or was the registry storing the path something that is newer?
Maybe there's nothing to do here though if older versions were always called np32dsw.dll exactly and newer versions are named after the version.
Assignee | ||
Comment 21•12 years ago
|
||
As long as the convention that newer versions are named after their version holds, I think this is resolved/WFM.
Assignee | ||
Comment 22•12 years ago
|
||
Please re-open if you disagree with Comment 21.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → WORKSFORME
Comment 23•12 years ago
|
||
Somewhere in the middle of 11.6 version of Shockwave, naming of the DLL after its version number is introduced. So the correct way to apply the patch would be by referring to File version (or Product version) field of np32dsw_XXXXXXX.dll. The version value to compare is 12.0.2.122.
So, "code to not call this SetDllDirectory("")" restriction is currently lifted out for these bucket of older Shockwave versions. So there might be users experiencing broken shockwave content when the compatibility module of Shockwave is in use.
So, I prefer, in addition to comparing for np32dsw.dll we also need to handle np32dsw_XXXXXXX.dll cases for anything below 12.0.2 version number.
Looking at the patch https://bugzilla.mozilla.org/attachment.cgi?id=487435&action=diff , pluginFileName is already available, so the registry path of np32dsw that I have mentioned in previous comments here might be irrelevant for this patch.
Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---
Assignee | ||
Comment 24•12 years ago
|
||
Reporter | ||
Updated•12 years ago
|
Attachment #754245 -
Flags: review?(ehsan) → review+
Assignee | ||
Comment 25•12 years ago
|
||
Comment 26•12 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 12 years ago → 12 years ago
status-firefox24:
--- → fixed
Resolution: --- → FIXED
Updated•12 years ago
|
status-firefox21:
--- → affected
status-firefox22:
--- → affected
status-firefox23:
--- → affected
status-firefox-esr17:
--- → affected
Updated•11 years ago
|
Whiteboard: [sg:want] blocks our deployment of a fix for a critical bug → [sg:want][adv-main24-] blocks our deployment of a fix for a critical bug
Updated•11 years ago
|
tracking-firefox-esr17:
--- → ?
Comment 27•11 years ago
|
||
Al can you explain "sec-want"? That doesn't seem to fit with our ESR landing criteria and it will be in ESR24 - why should we take this for the second-to-last esr17?
Flags: needinfo?(abillings)
Comment 28•11 years ago
|
||
Hmm...sec-want is a "nice to have." This is really working around a shockwave issue. I'd only take it because of plugin issues, maybe. I do think that we could probably skip it for ESR17 though.
Flags: needinfo?(abillings)
Comment 29•11 years ago
|
||
If we have it in ESR 24 then our users have the workaround - update to latest ESR once they are released. Let's not blow our ESR uplift criteria for this one.
Updated•11 years ago
|
status-b2g18:
--- → unaffected
Updated•10 years ago
|
Group: core-security
Updated•9 years ago
|
Product: Plugins → Plugins Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•