| Summary: | [launcher] Windows LoadLibrary search cwd DLL exploit | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Equinox | Reporter: | Andrew Niefer <aniefer> | ||||
| Component: | Framework | Assignee: | equinox.framework-inbox <equinox.framework-inbox> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | jdmiles, mukund, raji, stephen.francisco, tjwatson | ||||
| Version: | unspecified | Flags: | tjwatson:
review+
|
||||
| Target Milestone: | 3.4.2+ | ||||||
| Hardware: | PC | ||||||
| OS: | Windows All | ||||||
| Whiteboard: | |||||||
| Bug Depends on: | 325902 | ||||||
| Bug Blocks: | |||||||
| Attachments: |
|
||||||
|
Description
Andrew Niefer
Created attachment 179399 [details]
patch
Here is the patch I'm currently working with. I have confirmed it does prevent finding dlls in the current working directory, I have run under both ansi and unicode versions. the patch for >=3.6 will differ slightly as we are unicode only starting in 3.6.
The launcher is currently being compiled with _WIN32_WINNT=0x0400, rather than changing this to 0x0502 and using the GetVersionEx to see if the SetDllDirectory method is available, I've instead loaded the Kernel32.dll and looked for the symbol directly. This is a pattern we've used before on various platforms (GetConsoleWindow is an example on windows).
Note this code is in the shared library, not first thing in the exe. This does allow for updating via p2. We have no code looking for shared libraries on the search path before here, the "Kernel32.dll" loading is safe because it is found in the system directories which are checked before the working directory, (as well, it is likely that the kernel32 image is already in memory because we do link with that library).
Binaries are recompiled and released. Tagged as R34x_20100922 (In reply to comment #2) > Binaries are recompiled and released. Tagged as R34x_20100922 The map file indicates R34x_v20100922 tag was used (with a 'v'). Yes, sorry, the tag contains a 'v', this was just a typo in the comment here. Removing security advisories group. The fix is available in 3.6.2. |