跳过内容

MASTG-TEST-0279: 剪贴板内容未过期

概述

此测试检查应用是否使用 UIPasteboard.setItems(_:options:) 方法和 UIPasteboard.Options.expirationDate 选项,为通用剪贴板的内容设置了过期日期。 如果敏感数据未设置过期日期而留在剪贴板中,其他应用可以无限期地访问它,从而导致潜在的数据泄露。

步骤

  1. 使用 radare2 for iOS 运行静态分析扫描,以检测 UIPasteboard.general 属性的使用情况。
  2. 使用 radare2 for iOS 运行静态分析扫描,以检测 UIPasteboard.setItems(_:options:) 方法的使用情况。

观察

输出应包含使用相关 API 的位置列表。

评估

如果应用使用通用剪贴板,但未为其内容设置过期日期,则测试失败。 具体来说,请确保调用 UIPasteboard.setItems(_:options:) 方法时使用了 UIPasteboard.Options.expirationDate 选项。