Out of bounds read in LiveCaption (CVE-2026-11301)
The GoogleApiTranslationDispatcher builds JSON request bodies with base::StringPrintf without escaping input strings, so a remote peer in a ChromeOS Boca session can inject arbitrary JSON keys via transcript messages. This allows API parameter injection or a denial of service by causing the translation API to return errors.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 45 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 go/chrome-ai-generated-security-bugs-faq for more information.
Overview: The GoogleApiTranslationDispatcher uses base::StringPrintf to construct JSON request bodies without escaping input strings. A remote peer in a ChromeOS Boca session can inject arbitrary JSON keys via transcript messages, leading to API parameter injection or a localized denial of service. The code also contains a fragile pattern using std::string_view::data() with %s.
Affected files:
components/live_caption/google_api_translation_dispatcher.ccchromeos/ash/components/boca/babelorca/babel_orca_caption_translator.ccchromeos/ash/components/boca/babelorca/babel_orca_consumer.cc
Estimated timestamp from git blame: 2025-12-02
Description
There is a potential JSON injection vulnerability in GoogleApiTranslationDispatcher::GetTranslation (components/live_caption/google_api_translation_dispatcher.cc). The function constructs a POST request body for the Google Cloud Translate API by interpolating strings into a JSON template using base::StringPrintf:
constexpr char kTranslateBodyRequestTemplate[] =
"{\"q\":\"%s\",\"source\":\"%s\",\"target\":\"%s\",\"format\":\"text\"}";
url_loader_->AttachStringForUpload(
base::StringPrintf(kTranslateBodyRequestTemplate, result.data(),
source_language.data(), target_language.data()),
kUploadContentType);
Because no JSON escaping is performed on result, source_language, or target_language, an attacker who controls these values can break out of the string boundaries by injecting characters like " and ,.
This code path is reachable by a remote peer in a ChromeOS Boca (School Tools) session. A producer (e.g., a teacher device) sends transcript messages (BabelOrcaMessage) via a Tachyon stream. The transcript text is parsed, placed into a media::SpeechRecognitionResult, and passed down to BabelOrcaCaptionTranslator::Translate and eventually to GoogleApiTranslationDispatcher::GetTranslation without any sanitization.
While the source_language and target_language parameters are validated via l10n_util::IsValidLocaleSyntax, this validation only strictly checks the prefix before an @ symbol. An attacker can supply a locale like en@k="x which passes validation but still permits JSON injection.
Impact
An authenticated remote producer can inject arbitrary JSON structures into the request body sent from the consumer's browser process to translation.googleapis.com. Since the request omits user credentials (CredentialsMode::kOmit) and relies on a hardcoded API key, the impact is isolated to the translation feature itself:
- Parameter Injection: An attacker can inject or override top-level JSON keys in the API request (e.g., supplying a transcript like
text","target":"ru). - Functional Denial of Service: Injecting invalid JSON syntax will cause the Cloud Translate API to return a 400 Bad Request error, breaking the live translation feature for the consumer.
Latent Code Health Issue
The result, source_language, and target_language arguments in GetTranslation are typed as std::string_view. Passing .data() from a std::string_view to a %s format specifier is unsafe as it does not guarantee null-termination, which could lead to an out-of-bounds read.
Codebase analysis confirms that all current callers (including BabelOrcaCaptionTranslator) pass std::string objects that are implicitly converted to std::string_view, meaning the buffers are safely null-terminated in practice today. However, this is a fragile pattern that could become an exploitable vulnerability if new callers are introduced.
Potential Reproduction Steps
Note: These are suggested steps based on static analysis; our tooling has not yet executed a working proof-of-concept.
- Establish a ChromeOS Boca session with an attacker acting as the producer (teacher) and a victim as the consumer (student).
- From the producer device, send a
BabelOrcaMessagewith transcript text containing JSON-breaking characters, such as:test text","target":"ru. - The consumer's browser process will receive the transcript and dispatch it for translation.
- Observe the outbound network request to
translation.googleapis.com. The body will contain the hijacked JSON:{"q":"test text","target":"ru","source":"...","target":"...","format":"text"}.
Suggested Fix
- Construct JSON Safely: Replace
base::StringPrintfwithbase::Value::Dictto build the request parameters, and usebase::JSONWriter::Writeto serialize it to a string. This ensures all values are properly escaped. - Fix String View Usage: Change the parameter types in
GoogleApiTranslationDispatcher::GetTranslationfromstd::string_viewtoconst std::string&, or explicitly convert thestd::string_viewto astd::stringbefore use, preventing potential out-of-bounds reads if a non-null-terminated view is ever passed.
Evaluated with Chrome root at commit: 7353d249d9cacf9c7218e1d7b8a39cf39c72d646
Results so far have been promising, but there can be wrong deductions. If this proves to be a false positive, please close as WAI; 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
The code uses base::StringPrintf to interpolate unescaped strings into a JSON template, and locale validation only checks the prefix before an '@' symbol.
Impact
An authenticated remote producer could inject arbitrary JSON structures into the request body, leading to parameter injection or a functional denial of service, but the impact is isolated to the translation feature because the request omits user credentials and uses a hardcoded API key.
What the attacker needed
ChromeOS Boca session; attacker as producer (teacher); victim as consumer (student)
The fix
The code should be fixed by constructing JSON safely with base::Value::Dict and base::JSONWriter::Write, and by changing string_view parameters to const std::string& or converting to std::string before use.
How it was found
- Establish a ChromeOS Boca session with an attacker as producer and a victim as consumer.
- From the producer device, send a BabelOrcaMessage with transcript text containing JSON-breaking characters.
- The consumer's browser process receives the transcript and dispatches it for translation.
- Observe the outbound network request to translation.googleapis.com containing the hijacked JSON.
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.
When a program builds a JSON request by pasting user text directly into a template, special characters like quotes can break the structure. Here, a teacher in a video session could send a transcript that changes the JSON sent to a translation service, altering its parameters or breaking it.
What is Misconfiguration?
Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.