473,404 Members | 2,137 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

Security Flaw in dll (or am I wrong?)

HI NG

I have made a very nasty discovery on my dll files build from my
ASP.NET projects in VS.NET 2003.

In some of my codebehind files i have a private string that is my SQL
Server connection string for example:

public class myClass
{
private string sqlSvrConStr = "Data Source=blablabla";
public myClass()
{
}
}

When I compile the project and opens the dll in notepad I am able to
read the sqlSvrConStr - it's not pretty and it might take a while to
find BUT IT'S THERE!!!

I am also able to find some of my SQL Command strings and other objects
I use in the code - is this of normal behavior of a dll that you
actually can see the code in text???

Man I'm getting nervous!!

-Kevin

Nov 19 '05 #1
11 1030

It's by design. You need to use an obfuscator that encrypts string literals.
Google for ".NET obfuscator", most of them are not free though.

-Oleg.

"Kevin Steffer [MCP]" <ks******@gmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
HI NG

I have made a very nasty discovery on my dll files build from my
ASP.NET projects in VS.NET 2003.

In some of my codebehind files i have a private string that is my SQL
Server connection string for example:

public class myClass
{
private string sqlSvrConStr = "Data Source=blablabla";
public myClass()
{
}
}

When I compile the project and opens the dll in notepad I am able to
read the sqlSvrConStr - it's not pretty and it might take a while to
find BUT IT'S THERE!!!

I am also able to find some of my SQL Command strings and other objects
I use in the code - is this of normal behavior of a dll that you
actually can see the code in text???

Man I'm getting nervous!!

-Kevin

Nov 19 '05 #2
Well, you could also reverse engineer hard coded string in C++ code too.
Other than .NET assemblies being slightly easier to read, what's the difference?

BTW, to make you even more nervous, you should check out Reflector:

http://www.aisto.com/roeder/dotnet/

To be secure you should store the connection string in your config file encrypted
with DPAPI. Dominick has some tools for this:

http://www.leastprivilege.com/PermaL...8-6ff79a60e43f

-Brock
DevelopMentor
http://staff.develop.com/ballen
HI NG

I have made a very nasty discovery on my dll files build from my
ASP.NET projects in VS.NET 2003.

In some of my codebehind files i have a private string that is my SQL
Server connection string for example:

public class myClass
{
private string sqlSvrConStr = "Data Source=blablabla";
public myClass()
{
}
}
When I compile the project and opens the dll in notepad I am able to
read the sqlSvrConStr - it's not pretty and it might take a while to
find BUT IT'S THERE!!!

I am also able to find some of my SQL Command strings and other
objects I use in the code - is this of normal behavior of a dll that
you actually can see the code in text???

Man I'm getting nervous!!

-Kevin


Nov 19 '05 #3
I'd be nervous too, if somehow someone on the Internet could get hold of my
DLLs. Now THAT would be a security issue!

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Ambiguity has a certain quality to it.

"Kevin Steffer [MCP]" <ks******@gmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
HI NG

I have made a very nasty discovery on my dll files build from my
ASP.NET projects in VS.NET 2003.

In some of my codebehind files i have a private string that is my SQL
Server connection string for example:

public class myClass
{
private string sqlSvrConStr = "Data Source=blablabla";
public myClass()
{
}
}

When I compile the project and opens the dll in notepad I am able to
read the sqlSvrConStr - it's not pretty and it might take a while to
find BUT IT'S THERE!!!

I am also able to find some of my SQL Command strings and other objects
I use in the code - is this of normal behavior of a dll that you
actually can see the code in text???

Man I'm getting nervous!!

-Kevin

Nov 19 '05 #4
Kevin Spencer wrote:
I'd be nervous too, if somehow someone on the Internet could get hold of my
DLLs. Now THAT would be a security issue!

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
Ambiguity has a certain quality to it.


What if we talk shipping dll's API and stuff like that - what would be
nessecary to keep the clean strings away from being readable in the
dll?

-Kevin

Nov 19 '05 #5
One could argue that all applications written using .NET are Open Source.

"Kevin Steffer [MCP]" <ks******@gmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
HI NG

I have made a very nasty discovery on my dll files build from my
ASP.NET projects in VS.NET 2003.

In some of my codebehind files i have a private string that is my SQL
Server connection string for example:

public class myClass
{
private string sqlSvrConStr = "Data Source=blablabla";
public myClass()
{
}
}

When I compile the project and opens the dll in notepad I am able to
read the sqlSvrConStr - it's not pretty and it might take a while to
find BUT IT'S THERE!!!

I am also able to find some of my SQL Command strings and other objects
I use in the code - is this of normal behavior of a dll that you
actually can see the code in text???

Man I'm getting nervous!!

-Kevin

Nov 19 '05 #6
You could encrypt your critical strings.

"Kevin Steffer [MCP]" <ks******@gmail.com> wrote in message
news:11*********************@o13g2000cwo.googlegro ups.com...
Kevin Spencer wrote:
I'd be nervous too, if somehow someone on the Internet could get hold of my DLLs. Now THAT would be a security issue!

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
Ambiguity has a certain quality to it.


What if we talk shipping dll's API and stuff like that - what would be
nessecary to keep the clean strings away from being readable in the
dll?

-Kevin

Nov 19 '05 #7
> You could encrypt your critical strings.

The problem with encrypting the strings is that you need a key to decrypt
them. Where do you store that? If the original intent was to hide the strings,
encrypting them just means you have to hide the key. Same problem.

-Brock
DevelopMentor
http://staff.develop.com/ballen

Nov 19 '05 #8
The difference is: For SQL connection string, there is clearly
distingrishable words that enables user to find it out easily.
If you're storing a key, the key may(or may not) look like other values. If
your program hold more than one key, it may take the user a while to figure
out which one you're using for decrypting the connection string.

Things can go more tricky if you choose to use Multibyte characters such as
Big5 in the key... You either have a key that won't decrypt at all(not all
encryption algorithm have a mind for high-ASCII values) or a key that's
difficult to be recognize(you can't tell by our eyes it's a legal string or
not after shifting bits)

"Brock Allen" <ba****@NOSPAMdevelop.com>
???????:90**********************@msnews.microsoft. com...
You could encrypt your critical strings.


The problem with encrypting the strings is that you need a key to decrypt
them. Where do you store that? If the original intent was to hide the
strings, encrypting them just means you have to hide the key. Same
problem.

-Brock
DevelopMentor
http://staff.develop.com/ballen

Nov 19 '05 #9
Don't do it.

"Kevin Steffer [MCP]" <ks******@gmail.com> wrote in message
news:11*********************@o13g2000cwo.googlegro ups.com...
Kevin Spencer wrote:
I'd be nervous too, if somehow someone on the Internet could get hold of
my
DLLs. Now THAT would be a security issue!

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
Ambiguity has a certain quality to it.


What if we talk shipping dll's API and stuff like that - what would be
nessecary to keep the clean strings away from being readable in the
dll?

-Kevin

Nov 19 '05 #10
bradley shared this with us in microsoft.public.dotnet.framework.aspnet:
One could argue that all applications written using .NET are Open
Source.


Open source doesn't just mean access to the source code. The
distribution terms of open-source software must comply with the
following criteria:

1. Free Redistribution
2. Source Code
3. Derived Works
4. Integrity of The Author's Source Code
5. No Discrimination Against Persons or Groups
6. No Discrimination Against Fields of Endeavor
7. Distribution of License
8. License Must Not Be Specific to a Product
9. License Must Not Restrict Other Software
10. License Must Be Technology-Neutral

Details on http://www.opensource.org/docs/definition.php

--
Amedee Van Gasse
Nov 19 '05 #11
Well, MSIL can be obfuscated. VS.Net comes with an bfuscator, and there are
others available as well.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Ambiguity has a certain quality to it.

"Shaun Wilson" <mr***********@msn.com> wrote in message
news:eu**************@TK2MSFTNGP15.phx.gbl...
Don't do it.

"Kevin Steffer [MCP]" <ks******@gmail.com> wrote in message
news:11*********************@o13g2000cwo.googlegro ups.com...
Kevin Spencer wrote:
I'd be nervous too, if somehow someone on the Internet could get hold of
my
DLLs. Now THAT would be a security issue!

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
Ambiguity has a certain quality to it.


What if we talk shipping dll's API and stuff like that - what would be
nessecary to keep the clean strings away from being readable in the
dll?

-Kevin


Nov 19 '05 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

28
by: grahamd | last post by:
Who are the appropriate people to report security problems to in respect of a module included with the Python distribution? I don't feel it appropriate to be reporting it on general mailing lists.
5
by: christophe (dot) poucet (at) gmail (dot) com | last post by:
Hello, I noticed there is a flaw in the vector implementation of g++ (3.4). Basically when you erase an element from a vector, it calls the wrong destructor. In most cases this is not such a...
116
by: Mike MacSween | last post by:
S**t for brains strikes again! Why did I do that? When I met the clients and at some point they vaguely asked whether eventually would it be possible to have some people who could read the data...
24
by: Bob Alston | last post by:
Could develop web pages that would interact with the access/jet database - like DAP but without the security flaw??? One of Access' competitors (Filemaker Pro as I recall) touts its EASY way to...
8
by: Aravind | last post by:
I am Aravind.Could someone provide me with a list of specific guidelines for secure programming in C/C++?.I would like to use those guidelines for developing a security application to deal with...
0
by: honcho | last post by:
My ASP.NET web application has a flaw that produces false security-violation alarms. There are several categories of users for this web site, e.g. Colonels, Sergeants, Private_1s, and...
8
by: Matt Kruse | last post by:
http://news.zdnet.com/2100-1009_22-6121608.html Hackers claim zero-day flaw in Firefox 09 / 30 / 06 | By Joris Evers SAN DIEGO--The open-source Firefox Web browser is critically flawed in...
0
by: Anthony Baxter | last post by:
SECURITY ADVISORY Buffer overrun in repr() for UCS-4 encoded unicode strings http://www.python.org/news/security/PSF-2006-001/ Advisory ID: PSF-2006-001 Issue Date: October 12, 2006...
3
by: Annonymous Coward | last post by:
I recently downloaded and install SQLServer Express. I am considering using it as the backend db for my app (i.e. moving from the current PostgreSQL). I run sqlcmd without specifying any...
1
by: Guy Macon | last post by:
Serious Security Flaw in Google Chrome: http://www.readwriteweb.com/archives/security_flaw_in_google_chrome.php -- Guy Macon <http://www.GuyMacon.com/>
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.