简体   繁体   English

为什么在Snoop中可以看到PasswordBox的密码?

[英]Why can I see the password of a PasswordBox in Snoop?

I am trying to understand how does PasswordBox protect the reading of the password from an external application. 我试图了解PasswordBox如何保护从外部应用程序读取密码。 And what I don't understand is how come I have the capacity to read the password of my WPF window with Snoop : 我不明白的是,我怎么能用Snoop读取WPF窗口的密码:

在此处输入图片说明

I thought this was the kind of breach that PasswordBox was supposed to solve. 我认为这是PasswordBox应该解决的那种违规行为。

In order to be useable - at one point or another - the password must be in memory as a clear string and/or must be retreivable as a clear string. 为了能够在某一时刻或另一地点被使用,密码必须作为明文字符串存储在内存中和/或必须作为明文字符串可检索。 SecureString and PasswordBox limit that time of vulnerability. SecureString和PasswordBox限制了该漏洞的持续时间。 But they can not get rid of it. 但是他们不能摆脱它。 It can do stuff like force agressive collection by the GC, prevent Optimsiations like String itnerning and even overwriting the memory with random data the moment it runs out of scope. 它可以做一些事情,例如由GC强制收集,防止像字符串迭代这样的优化,甚至在超出范围时用随机数据覆盖内存。

The Passwrod property is how you retrieve said naked string. Passwrod属性是您检索裸露字符串的方式。 And snoop can apparently query it just like your code can. snoop可以像查询代码一样查询它。

Personally I think that if an attacker can read your memory, you pretty much lost the Security Battle already. 我个人认为,如果攻击者可以读取您的记忆,则您已经几乎失去了安全之战。 If you got a encrypted value in memory, you propably have the key there too. 如果您在内存中获得了加密的值,则也可能在那里拥有密钥。 Together with the code actually working on both. 连同实际在两者上都起作用的代码。 So it is not like an attacker could not decrypt it the same way you would. 因此,这并不像攻击者无法以相同的方式解密它。 The task is a bit more complex, but that is it. 任务稍微复杂一点,但仅此而已。

The vulnerability to memory reads is why Heartbleed was such a huge thing. 内存读取的漏洞是Heartbleed之所以如此重要的原因。 You have to blindly trust the RAM. 您必须盲目地信任RAM。 Because if it is compromised, there is nothing you can do about it. 因为如果它遭到破坏,您将无能为力。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM