Skip to content

Enhance best practices for preventing keyboard caching in sensitive text inputs#3573

Open
cpholguera wants to merge 2 commits intomasterfrom
keyboard-cache-best-know
Open

Enhance best practices for preventing keyboard caching in sensitive text inputs#3573
cpholguera wants to merge 2 commits intomasterfrom
keyboard-cache-best-know

Conversation

@cpholguera
Copy link
Collaborator

@cpholguera cpholguera commented Dec 6, 2025

This PR enhances iOS security documentation by expanding guidance on preventing keyboard caching of sensitive text inputs. It updates both the knowledge base article on keyboard caching and the best practices guide to provide comprehensive, security-focused recommendations.

File Description
knowledge/ios/MASVS-STORAGE/MASTG-KNOW-0100.md Enhanced documentation of iOS keyboard caching behavior with forensic context, detailed explanations of UITextInputTraits properties, and their security implications
best-practices/MASTG-BEST-0026.md Added best practices with specific configuration recommendations for preventing keyboard caching in sensitive text inputs

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances iOS security documentation by expanding guidance on preventing keyboard caching of sensitive text inputs. It updates both the knowledge base article on keyboard caching and the best practices guide to provide comprehensive, security-focused recommendations.

  • Expanded technical details about iOS keyboard caching mechanisms and forensic implications
  • Documented the UITextInputTraits protocol properties that control keyboard learning behavior
  • Established clear best practices for configuring text fields handling sensitive information

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.

File Description
knowledge/ios/MASVS-STORAGE/MASTG-KNOW-0100.md Enhanced documentation of iOS keyboard caching behavior with forensic context, detailed explanations of UITextInputTraits properties, and their security implications
best-practices/MASTG-BEST-0026.md Converted from placeholder to complete best practice guide with specific configuration recommendations for preventing keyboard caching in sensitive text inputs

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@cpholguera cpholguera requested a review from serek8 December 6, 2025 18:57
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Collaborator

@bernhste bernhste left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am aware that architecture and design were removed since V1. But data classification in this case seems important. I would at least mention it and refer to policies, etc.

---

Several options, such as autocorrect and spell check, are available to users to simplify keyboard input and are cached by default in `.dat` files in `/private/var/mobile/Library/Keyboard/` and its subdirectories.
Several features such as autocorrection, spell checking, and predictive suggestions help users enter text more quickly. On iOS, these features are backed by on-device keyboard dictionaries that are persisted in `.dat` files under `/private/var/mobile/Library/Keyboard/` and its subdirectories. Forensic analyses and security research show that user-typed terms, including previously unknown words, can appear in files such as `dynamic-text.dat` in this directory and may be recoverable during device analysis.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: This topic explains best practices to prevent sensitive text inputs from being cached by the iOS keyboard.
---

Sensitive text inputs should never participate in keyboard learning or prediction. On iOS, this means explicitly disabling features that allow the system keyboard to cache or reuse previously entered values. By default, standard text fields are eligible for caching unless told otherwise, which makes explicit configuration essential for any field that handles secrets or identifiers.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Sensitive text inputs should never participate in keyboard learning or prediction. On iOS, this means explicitly disabling features that allow the system keyboard to cache or reuse previously entered values. By default, standard text fields are eligible for caching unless told otherwise, which makes explicit configuration essential for any field that handles secrets or identifiers.
Sensitive text inputs should never participate in keyboard learning or prediction. What is defined as sensitve text, should be carefully evaluated for all text input based on data protection laws, industry regulations, company policies or individual assessment.
On iOS, this means explicitly disabling features that allow the system keyboard to cache or reuse previously entered values. By default, standard text fields are eligible for caching unless told otherwise, which makes explicit configuration essential for any field that handles secrets or identifiers.

Should we add a sentence about how to classify data first (data protection law, industry standard like PCI-DSS, etc.)?

Because this best practice should be applied to all text input and not just obvious ones like password forms. For example, an app for lawyers, or critical infrastructure can have many sensitive text input forms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants