Free Republic
Browse · Search
General/Chat
Topics · Post Article

Skip to comments.

Windows DLL Vulnerability: Microsoft Security Flaw
Computerworld ^ | August 23, 2010 | Gregg Keizer

Posted on 08/24/2010 11:30:28 AM PDT by stripes1776

click here to read article


Navigation: use the links below to view more comments.
first previous 1-2021-4041-6061-8081-86 next last
To: discostu

Yeah, I am getting the gist of it. Incredible. Like Tom Petty says... “there ain’t no easy way out”.


21 posted on 08/24/2010 3:04:45 PM PDT by RachelFaith (2010 is going to be a 100 seat Tsunami - Unless the GOP Senate ruins it all...)
[ Post Reply | Private Reply | To 20 | View Replies]

To: Swordmaker
I though you might like to know about this security hole in Windows operating systems.
22 posted on 08/24/2010 3:27:39 PM PDT by stripes1776
[ Post Reply | Private Reply | To 1 | View Replies]

To: RachelFaith

Really this is an example of you can’t protect users from themselves. If they’re dumb enough to plant an infected version of a common dll somewhere then bad things are going to happen and there’s no way to stop it. Every OS is vulnerable to trojans, if you allow the users to install good software (which of course you have to) then you’re also allowing them to install bad software.


23 posted on 08/24/2010 3:32:05 PM PDT by discostu (Keyser Soze lives)
[ Post Reply | Private Reply | To 21 | View Replies]

To: RachelFaith

It doesn’t load random dlls, it will only load dlls requested by an exe or dll. But those could in theory be hacked and swapped.


24 posted on 08/24/2010 3:35:18 PM PDT by discostu (Keyser Soze lives)
[ Post Reply | Private Reply | To 19 | View Replies]

To: stripes1776
The user does not have to download and install an application. The application is already installed. The installed applications use .dll files. These .dll files will download automatically and run as part of the application. All the malicious hacker has to do is put a malicious .dll file in the same folder as the data you are looking at in an application. There is nothing to install.

Hmmm... Downloading and saving a file is pretty much under the control of the user, as I stated above. It's installing the DLL in the right directory (or at least into a system folder). Either you get the user to manually copy the DLL to the proper folder, or you run a local executable (even a batch file) that will copy the file from your downloads folder to the system or application folder.

Either way, SOMEONE is "installing" the DLL in that it has to be properly positioned within your folder structure. Not in the system path or application directory - it's not loaded.

This is nothing more than a classic trojan, but is with DLLs rather than full executables. Meaning it's a partial executable (you can consider a DLL as a fraction of a program, containing executable code and data that is shared amongst multiple applications).

I'm 100% confident that if I downloaded that infected DLL to my machine, as I download everything else (to a desktop folder called "Downloads") that nothing would happen. That folder is not in the system path, nor is it in ANY path for any application. That DLL would sit there forever, never accessed or touched, because the application that normally calls it wouldn't have a CLUE to look for an alternate version in my desktop download folder.

I would have to physically move the DLL, or execute an application to move it, to a system folder or the folder of the targeted application in order for it to become a "live" infection.

25 posted on 08/24/2010 4:15:22 PM PDT by PugetSoundSoldier (Indignation over the Sting of Truth is the defense of the indefensible)
[ Post Reply | Private Reply | To 12 | View Replies]

To: discostu; RachelFaith
Exactly. It's not like just opening a document (say a PDF, PowerPoint, Writer, or other file with an embedded font) could infect your whole machine via an arbitrary code execution bug...

You need to actually have a user dumb enough to move things around, or modify paths to cause this to be an issue. Or modify the default behavior of IE to cause it.

This problem has been around for 4 years at the very least, and as you say above, there's no way to protect a computer from infection if the user doesn't know what they're doing.

Leave downloads in a download directory and everything will be OK. Or be smart enough to NOT download/accept DLLs and EXEs from unknown sites.

26 posted on 08/24/2010 4:24:14 PM PDT by PugetSoundSoldier (Indignation over the Sting of Truth is the defense of the indefensible)
[ Post Reply | Private Reply | To 24 | View Replies]

To: PugetSoundSoldier
Hmmm... Downloading and saving a file is pretty much under the control of the user, as I stated above. It's installing the DLL in the right directory (or at least into a system folder). Either you get the user to manually copy the DLL to the proper folder, or you run a local executable (even a batch file) that will copy the file from your downloads folder to the system or application folder.

This is not about downloading and saving a file. It's about looking at data. The .dll file does not have to be in a system folder or the application folder. It doesn't even have to be on your computer. It only has to be in the folder where the data is located. If you are viewing your data from a network server, the user does not have control of where the .dll file is loaded from.

27 posted on 08/24/2010 4:40:44 PM PDT by stripes1776
[ Post Reply | Private Reply | To 25 | View Replies]

To: stripes1776

You sure you know how a DLL works, and what a system path is? I don’t think you do...


28 posted on 08/24/2010 5:06:05 PM PDT by PugetSoundSoldier (Indignation over the Sting of Truth is the defense of the indefensible)
[ Post Reply | Private Reply | To 27 | View Replies]

To: PugetSoundSoldier
You sure you know how a DLL works, and what a system path is? I don’t think you do...

That's funny because I was thinking the same thing about you.

Every application has a current directory. Every running process has a current directory (folder is the more modern term), but back in the days of DOS, they were called directories. And to run with an application and open a data file, you could move to a directory that contained your data from the DOS prompt, for example "C:\Work\Data\", run the application from the DOS prompt (you had to run it from the command line because there were no graphical windows back them), and simply specify the data file with a relative name: "meme.txt" for example. The current directory of the application would be "C:\Work\Data", regardless of where the executable file was actually kept on the system.

Now look at this from the article:

Many Windows programs can be exploited simply by tricking users into visiting malicious Web sites or opening malformed documents because of the way the software loads code libraries -- dubbed "dynamic-link library," or ".dll" in Windows -- as well as executable ".exe" and ".com" files. If hackers can plant disguised malware in one of the directories an application searches when it looks for those files, they can hijack the PC.

If the current directory of your application is "C:\Work\Data\" and you open an data file in that directory, and the application looks in the current directory for .dll files, and a malicious hacker has put a malicious .dll file in that directory, the system will load that .dll file and execute it as part the application's code. And that's the problem.

29 posted on 08/24/2010 5:48:57 PM PDT by stripes1776
[ Post Reply | Private Reply | To 28 | View Replies]

To: RachelFaith
I mean, it’s below OS level error, it’s systemic.

It's systemic, but I wouldn't call it below OS level.

Every program calls and looks for dll’s.

Mine don't specifically look for any DLLs, so wouldn't be subject to this flaw. I compile everything into the executable. I avoid P/Invoke like the plague. Of course my programs aren't quite as big as the vulnerable ones mentioned. They could indirectly call DLLs by invoking C# methods that cause the runtime to invoke DLLs, but those would be called within the .NET system to known locations. You'd need a broke .NET installation to make it vulnerable, and then that might cause the program to not run in the first place.

Yes, I am a Windows developer, and my favorite language is C#.

30 posted on 08/24/2010 5:58:09 PM PDT by antiRepublicrat
[ Post Reply | Private Reply | To 15 | View Replies]

To: stripes1776

OK, you have confirmed you don’t understand DLLs. They don’t open in the directory of data, but the application directory or system path. That’s how it works on Windows; you MAY load a DLL when opening a file, but it’s loaded from the app folder or system path.


31 posted on 08/24/2010 6:00:47 PM PDT by PugetSoundSoldier (Indignation over the Sting of Truth is the defense of the indefensible)
[ Post Reply | Private Reply | To 29 | View Replies]

To: PugetSoundSoldier
Downloading and saving a file is pretty much under the control of the user, as I stated above.

The paper stated they remotely forced IE to download a file to the desktop. If the user hadn't noticed the download and deleted it, the next time IE is started it would look to the desktop for its DLL, find this one, and execute it. No user intervention required. This was actually done, not theoretical.

That folder is not in the system path, nor is it in ANY path for any application.

There's no way a regular user would know that. You need disassembling or debugging tools. This stuff is hard-coded into the application. In Visual Studio it is done through the project properties. Additional paths can be added using the SetDllDirectory() function in the code. In addition to that, Windows has its own places it looks by default. It's not just the Windows directory or other normally protected locations, but includes the current directory and any directory in the PATH environment variable.

I'm 100% confident that if I downloaded that infected DLL to my machine, as I download everything else (to a desktop folder called "Downloads") that nothing would happen.

If your current directory at the time of execution is %USERPROFILE%\Desktop\Downloads, you're screwed.

32 posted on 08/24/2010 6:24:15 PM PDT by antiRepublicrat
[ Post Reply | Private Reply | To 25 | View Replies]

To: PugetSoundSoldier; stripes1776
OK, you have confirmed you don’t understand DLLs. They don’t open in the directory of data, but the application directory or system path.

DLLs are loaded from wherever they're found on the computer. Windows doesn't care, and there is no checking done for any kind of approved or secure locations. There are several methods by which any directory on the computer could be searched for a DLL.

I am a professional Windows developer, and you have confirmed you don't understand DLLs.

33 posted on 08/24/2010 6:50:18 PM PDT by antiRepublicrat
[ Post Reply | Private Reply | To 31 | View Replies]

To: PugetSoundSoldier
OK, you have confirmed you don’t understand DLLs. They don’t open in the directory of data, but the application directory or system path. That’s how it works on Windows; you MAY load a DLL when opening a file, but it’s loaded from the app folder or system path.

On the contrary. You have demonstrated beyond doubt that you do not understand how Windows programs load .dll files. And it is this lack of understanding of .dll files that leads programmers to write code that is vulnerable to loading a malicious .dll files.

34 posted on 08/24/2010 7:17:29 PM PDT by stripes1776
[ Post Reply | Private Reply | To 31 | View Replies]

To: PugetSoundSoldier; antiRepublicrat
If your current directory at the time of execution is %USERPROFILE%\Desktop\Downloads, you're screwed.

Exactly.

35 posted on 08/24/2010 7:21:38 PM PDT by stripes1776
[ Post Reply | Private Reply | To 32 | View Replies]

To: PugetSoundSoldier
OK, you have confirmed you don’t understand DLLs. They don’t open in the directory of data, but the application directory or system path. That’s how it works on Windows; you MAY load a DLL when opening a file, but it’s loaded from the app folder or system path.

You don't understand the Dynamic-Link Library Search Order. Here is a link to Microsoft's website where they explain the order of the search: http://msdn.microsoft.com/en-us/library/ms682586(v=VS.85).aspx.

Here are two most common possibilities for the search order:

    If SafeDllSearchMode is enabled, the search order is as follows:
  1. The directory from which the application loaded.
  2. The system directory. Use the GetSystemDirectory function to get the path of this directory.
  3. The 16-bit system directory. There is no function that obtains the path of this directory, but it is searched.
  4. The Windows directory. Use the GetWindowsDirectory function to get the path of this directory.
  5. The current directory.
  6. The directories that are listed in the PATH environment variable. Note that this does not include the per-application path specified by the App Paths registry key. The App Paths key is not used when computing the DLL search path.
    If SafeDllSearchMode is disabled, the search order is as follows:
  1. The directory from which the application loaded.
  2. The current directory.
  3. The system directory. Use the GetSystemDirectory function to get the path of this directory.
  4. The 16-bit system directory. There is no function that obtains the path of this directory, but it is searched.
  5. The Windows directory. Use the GetWindowsDirectory function to get the path of this directory.
  6. The directories that are listed in the PATH environment variable. Note that this does not include the per-application path specified by the App Paths registry key. The App Paths key is not used when computing the DLL search path.
As you will see, the current directory is searched in either order. And if the name of the .dll file in the current directory is unique, then safe mode is not really safe at all.
36 posted on 08/24/2010 9:05:29 PM PDT by stripes1776
[ Post Reply | Private Reply | To 31 | View Replies]

To: stripes1776

Do you know what the current directory is? It’s NOT the data directory, you might want to check that out. Write an app, and do a GetCurrentDirectory() call and tell me what you get returned.

HINT: it’s not the default data directory...


37 posted on 08/24/2010 10:56:56 PM PDT by PugetSoundSoldier (Indignation over the Sting of Truth is the defense of the indefensible)
[ Post Reply | Private Reply | To 36 | View Replies]

To: stripes1776

Oh, and note the order things are checked for the DLL (a SPECIFIC NAMED DLL that is called from the application); if you find that DLL in the application directory (you haven’t deleted it, have you?) or the system directory (the other place things are typically installed), then you STOP SEARCHING, you never get even further IF for some reason the application changed the current working directory.

Seriously, have you ever written a Windows app? This is pretty basic stuff...


38 posted on 08/24/2010 10:58:21 PM PDT by PugetSoundSoldier (Indignation over the Sting of Truth is the defense of the indefensible)
[ Post Reply | Private Reply | To 36 | View Replies]

To: antiRepublicrat

By default, IE stores downloads into a “Download” directory. You need to change - as user - the path to store things, or use another browser (such as Safari, which I linked to) that stores downloads locally on the desktop. THEN you can run into this with IE.

It’s certainly not with any application trying to read data as stripes is trying to claim...


39 posted on 08/24/2010 10:59:52 PM PDT by PugetSoundSoldier (Indignation over the Sting of Truth is the defense of the indefensible)
[ Post Reply | Private Reply | To 32 | View Replies]

To: antiRepublicrat; stripes1776
I am a professional Windows developer, and you have confirmed you don't understand DLLs.

Welcome to the club; I've been programming on Windows for the better part of 2 decades as well. Apparently you've encountered a standard where DLLs are not in the application directory or the system path? Where they're kept on the desktop? If that's the standard of your shop, I'd suggest changing your practices...

40 posted on 08/24/2010 11:01:55 PM PDT by PugetSoundSoldier (Indignation over the Sting of Truth is the defense of the indefensible)
[ Post Reply | Private Reply | To 33 | View Replies]


Navigation: use the links below to view more comments.
first previous 1-2021-4041-6061-8081-86 next last

Disclaimer: Opinions posted on Free Republic are those of the individual posters and do not necessarily represent the opinion of Free Republic or its management. All materials posted herein are protected by copyright law and the exemption for fair use of copyrighted works.

Free Republic
Browse · Search
General/Chat
Topics · Post Article

FreeRepublic, LLC, PO BOX 9771, FRESNO, CA 93794
FreeRepublic.com is powered by software copyright 2000-2008 John Robinson