android - 为什么 printStackTrace() 对移动 (Android) 应用程序存在安全风险?

标签 android security

我在互联网上发现了几个地方,他们提到使用该方法

Throwable.printStackTrace() 

您的 Android 应用程序会带来安全风险(这也是不好的编码实践。)我想了解为什么它会带来安全风险?攻击者可以使用以下提供的信息做什么

e.printStackTrace();

例如,其中 e 是 Exception 类型?

最佳答案

好吧,作为开发人员,您永远不会希望最终用户了解应用程序后面发生的情况。我现在能想到的有以下几点。

  • A stack trace should never be visibile to end users

  • Generating a stack trace is a relatively tedious process

  • Many logging frameworks are available for that

  • Printing the stack trace does not constitute error handling. It should be combined with other information logging and exception handling.

我使用相同的链接来回答您的问题,因为两者都是相关的!

关于android - 为什么 printStackTrace() 对移动 (Android) 应用程序存在安全风险?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29546496/

相关文章:

android - 第一次没有得到服务器 android volley 的响应

security - asp.net core 身份 cookie 重放攻击

ruby-on-rails - rails : mass-assignment security concern with belongs_to relationships

android - 使用 Android Mobile Vision API 在文本中搜索特定模式

android - 如何导航到不在返回堆栈上的父 Activity ?

javascript - Onsen UI 2.0 如何改变 Material 颜色?

android - 不推荐使用 showDialog。有什么选择?

php - 如何防止 PHP 中的 SQL 注入(inject)?

javascript - 如何避免登录用户通过控制台使用ajax?

asp.net - 我的事件日志充满了 ViewState 无效和未处理的异常