Insufficient validation of untrusted input in iOSWeb (CVE-2026-13777)
The iOS Annotations feature did not enforce its intended 64 KiB limit on text extracted from web pages, so a malicious site could send unbounded strings from the sandboxed web content process to the privileged browser process. This could cause resource exhaustion or, if the tokenizer or TFLite classifier has a flaw, memory corruption.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 48 days
Project Fortify, an experimental security project, has identified the following potential security issue. If you're a feature owner CC-ed on this bug, please do your best to review these reports without the Chrome Security team. Please see https://chromium.googlesource.com/chromium/src/+/main/docs/security/ai-generated-security-bugs-faq.md for more information.
Overview: The iOS Annotations feature fails to enforce intended length limits for text extracted from web pages and sent to the browser process. A malicious website can bypass the 64 KiB limit, sending unbounded strings from a sandboxed WebContent process to a privileged browser process. This data is subsequently processed by a TFLite-based classifier, potentially leading to memory corruption or resource exhaustion.
Affected files:
ios/web/annotations/annotations_java_script_feature.mmios/web/annotations/annotations_text_manager_impl.mmios/chrome/browser/web/model/annotations/annotations_tab_helper.mmios/web/annotations/resources/text_main.tsios/web/annotations/resources/text_extractor.ts
Estimated timestamp from git blame: 2024-01-17
Description
A potential validation gap in the iOS Annotations pipeline allows a malicious webpage to send unbounded text and metadata from the web content (WKWebView) to the browser process. While a 64 KiB limit (kMaxAnnotationsTextLength) is defined in the native code, it is not enforced during extraction or upon receipt. This results in arbitrarily large strings reaching a TFLite-based classifier running in the privileged iOS browser process.
Root Cause Analysis
The vulnerability stems from multiple missing validation steps in the communication pipeline between the injected JavaScript and the native browser code:
-
Failure to Pass Limits to JavaScript: In
ios/web/annotations/annotations_java_script_feature.mm, theExtractTextfunction receives amaximum_text_lengthparameter (65535) but fails to include it in theparameterslist passed to theannotations.startJavaScript function (lines 44-55). -
Unrestricted JavaScript Extraction: In
ios/web/annotations/resources/text_extractor.ts, the extraction logic collects and concatenates text nodes without enforcing a cumulative length limit (lines 122-128). -
Missing Native-Side Validation: In
ios/web/annotations/annotations_java_script_feature.mm, theScriptMessageReceivedhandler processes theannotations.extractedTextcommand. It extracts thetextstring but does not verify its length before passing it to theAnnotationsTextManagerImpl(lines 131-139). -
Processing in Privileged Process: The unbounded strings are ultimately passed to
ios::provider::ExtractTextAnnotationFromTextviaAnnotationsTabHelper::OnTextExtracted(ios/chrome/browser/web/model/annotations/annotations_tab_helper.mm:137). This function executes in the main application process (the browser process) and utilizes a complex TFLite model for text classification.
Potential Impact
On iOS, although all applications are sandboxed by the OS, the browser process acts as the privileged coordinator for the application. Exposing this process to unbounded, web-controlled input increases the attack surface:
- Resource Exhaustion: A malicious page could cause the browser process to consume excessive memory by sending very large text nodes, potentially leading to an out-of-memory (OOM) condition.
- Memory Corruption: The unbounded strings are processed by the in-process annotator. Any vulnerability in the tokenizer or the TFLite inference engine could be leveraged to achieve memory corruption within the browser process tier.
Suggested Potential Steps to Trigger
- Host an HTTPS page containing a very large text node (e.g., >100 MB).
- Navigate to this page using Chrome on iOS.
- The
AnnotationsTextManagerImplwill trigger text extraction automatically on page load. - The injected JavaScript will send the full, unbounded text back to the browser process via
sendWebKitMessage. - The browser process will receive and attempt to process the large payload in
AnnotationsTabHelper::OnTextExtractedand the subsequent ThreadPool task.
Recommended Mitigation
- Update
AnnotationsJavaScriptFeature::ExtractTextto pass themaximum_text_lengthto theannotations.startJavaScript function. - Modify the JavaScript extraction logic in
text_extractor.tsto respect the provided length limit. - Implement explicit size and content validation for the
textstring andmetadatafields inAnnotationsJavaScriptFeature::ScriptMessageReceivedbefore further processing.
Evaluated with Chrome root at commit: b3153093eb3c78c3e88ccf562bcbc20437a04b0e
Results so far have been promising, but there can be wrong deductions. Feel free to adjust as follows:
- If you are familiar with the severity guidelines, you may adjust the severity.
- If this is a false positive, and there's no work to be done, please close as WAI.
- If there is work to do here but not a vulnerability, please change the issue type to Task/Bug/FR.
Data from false positives will be used to improve accuracy over time. And please feel free to reach out to me directly if you have concerns or feedback on the project.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the maximum text length was defined in native code but never passed to the JavaScript extractor and never checked when the extracted text message was received.
Impact
A malicious page could cause the browser process to consume excessive memory and potentially reach an out-of-memory condition, and any flaw in the tokenizer or TFLite engine could be leveraged for memory corruption within the browser process.
What the attacker needed
Chrome on iOS; Victim visits a malicious HTTPS page; Annotations feature enabled
The fix
The fix should pass the maximum text length to the JavaScript extractor, make the extractor respect that limit, and validate the size and content of the text and metadata on the native side before processing.
How it was found
- Host an HTTPS page containing a very large text node.
- Navigate to the page using Chrome on iOS.
- Text extraction is triggered automatically on page load.
- The injected JavaScript sends the full, unbounded text back to the browser process.
- The browser process receives and attempts to process the large payload.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
On iOS, web pages run in a restricted process, while the browser itself runs in a more powerful process. This report says a web page could send a very large amount of text to the browser process because a size limit was defined but never actually applied. That could make the browser use too much memory, or possibly crash or corrupt memory if the text-processing code has another bug.
What is DoS?
A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.