Click here to Skip to main content
15,881,654 members
Home / Discussions / C#
   

C#

 
AnswerRe: getting data from internet Pin
pankajupadhyay292-Mar-11 5:14
professionalpankajupadhyay292-Mar-11 5:14 
GeneralRe: getting data from internet Pin
Cardon Fry2-Mar-11 7:33
Cardon Fry2-Mar-11 7:33 
AnswerRe: getting data from internet Pin
Bernhard Hiller2-Mar-11 23:07
Bernhard Hiller2-Mar-11 23:07 
QuestionHow can I use 3D modules(Such as DirectX or OpenGL)in my programming... Pin
hamidhesar2-Mar-11 0:37
hamidhesar2-Mar-11 0:37 
AnswerRe: How can I use 3D modules(Such as DirectX or OpenGL)in my programming... Pin
Pete O'Hanlon2-Mar-11 1:05
mvePete O'Hanlon2-Mar-11 1:05 
QuestionProblem in sending sms from pc to mobile through AT commands [modified] Pin
aeman1-Mar-11 23:27
aeman1-Mar-11 23:27 
AnswerRe: Problem in sending sms from pc to mobile through AT commands Pin
Thomas Krojer1-Mar-11 23:33
Thomas Krojer1-Mar-11 23:33 
QuestionAppDomain.CurrentDomain.SetData(SOME_SECRET_KEY, PrivateKey) [modified] Pin
devvvy1-Mar-11 22:53
devvvy1-Mar-11 22:53 
Hello

If I set some secret/sensitive information in AppDomain ...
AppDomain.CurrentDomain.SetData(SOME_SECRET_KEY, PrivateKey)

How can I protect it from third party dll loaded on demand? For example, in our application which hosts third party dll,
<br />
MaliciousLib = Assembly.LoadFrom(DllPath);<br />
oService = MaliciousLib.CreateInstance("xxxx.xxxx.xxxx");<br />
ISomeService Service = (ISomeService) oService;<br />
Service.DoSomeWork(...);<br />


Here, MaliciousLib can also access AppDomain and retrieves secret key.

I'm considering loading third party dll's into separate app domain (In which case they can't have access to the main AppDomain right...? In which case, next logical question - how 3rd party lib communicates back to main assembly... while it can't access main assembly's AppDomain variables, perhaps "function call return" would suffice ...)[^]

But I just done some testing, User dll methods can still access AppDomain.CurrentDomain!
<br />
oSecret = AppDomain.CurrentDomain.GetData("KEY1");<br />


Many articles discuss theories surrounding AppDomain, how one process can host multiple AppDomain and disaster occurring in one won't bring down the whole process - but really? Thought that's .NET v1 behavior - from v2 on disaster in one AppDomain will bring down the whole process. Also, regarding Get/SetData from security perspective, there's nothing on Google. From my experiment, there isn't any security control on Get/SetData![^]

So really how to protect main app from loaded third party components? Any suggestion?
dev
modified on Wednesday, March 2, 2011 11:25 PM

QuestionAssembly.GetExecutingAssembly - can we get "Key" which signed the assembly? Pin
devvvy1-Mar-11 22:49
devvvy1-Mar-11 22:49 
AnswerRe: Assembly.GetExecutingAssembly - can we get "Key" which signed the assembly? Pin
Keith Barrow1-Mar-11 23:23
professionalKeith Barrow1-Mar-11 23:23 
GeneralRe: Assembly.GetExecutingAssembly - can we get "Key" which signed the assembly? [modified] Pin
devvvy2-Mar-11 16:08
devvvy2-Mar-11 16:08 
QuestionHow to block read / write operation of cd/dvd [modified] Pin
Aisha sharma1-Mar-11 22:24
Aisha sharma1-Mar-11 22:24 
AnswerRe: How to block read / write operation of cd/dvd Pin
Keith Barrow1-Mar-11 22:55
professionalKeith Barrow1-Mar-11 22:55 
AnswerRe: How to block read / write operation of cd/dvd Pin
Dalek Dave7-Mar-11 11:22
professionalDalek Dave7-Mar-11 11:22 
QuestionLoad picture from resource file with XAML Pin
Mc_Topaz1-Mar-11 21:25
Mc_Topaz1-Mar-11 21:25 
AnswerRe: Load picture from resource file with XAML Pin
Pete O'Hanlon1-Mar-11 21:31
mvePete O'Hanlon1-Mar-11 21:31 
GeneralRe: Load picture from resource file with XAML Pin
Mc_Topaz1-Mar-11 21:36
Mc_Topaz1-Mar-11 21:36 
AnswerRe: Load picture from resource file with XAML Pin
ltuljo2-Mar-11 14:46
ltuljo2-Mar-11 14:46 
QuestionPostgres database connection Pin
Software20071-Mar-11 9:32
Software20071-Mar-11 9:32 
AnswerRe: Postgres database connection Pin
Orcun Iyigun1-Mar-11 9:38
Orcun Iyigun1-Mar-11 9:38 
GeneralRe: Postgres database connection Pin
Software20071-Mar-11 9:45
Software20071-Mar-11 9:45 
GeneralRe: Postgres database connection Pin
Dave Kreskowiak1-Mar-11 9:46
mveDave Kreskowiak1-Mar-11 9:46 
AnswerRe: Postgres database connection Pin
Dave Kreskowiak1-Mar-11 9:45
mveDave Kreskowiak1-Mar-11 9:45 
GeneralRe: Postgres database connection Pin
Software20071-Mar-11 9:56
Software20071-Mar-11 9:56 
AnswerRe: Postgres database connection Pin
Pete O'Hanlon1-Mar-11 9:56
mvePete O'Hanlon1-Mar-11 9:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.