BUG=501857663
Change-Id: I85191565ad48d76375111b9fd1557d8bbb6c9766Hamda Mare```suggestion
Fixed: 501857663
Change-Id: I85191565ad48d76375111b9fd1557d8bbb6c9766
```
Done
for (const auto& api_options_param : params->request.options) {
EXTENSION_FUNCTION_VALIDATE(base::IsStringUTF8(api_options_param.path));
base::FilePath file_path =
base::FilePath::FromUTF8Unsafe(api_options_param.path);
if (file_path.IsNetwork()) {
return RespondNow(Error("Invalid file path."));
}
}Hamda MareIs that the right way to return an error? It is different than what we do if the path is not UTF-8:
https://source.chromium.org/chromium/chromium/src/+/main:extensions/browser/extension_function.h;l=62?q=EXTENSION_FUNCTION_VALIDATE&ss=chromiumWould it not be simpler to just do:
```suggestion
bool paths_are_all_utf8 = true;
bool paths_are_all_local = true;
for (const auto& api_options_param : params->request.options) {
if (!base::IsStringUTF8(api_options_param.path)) {
paths_are_all_utf8 = false;
break;
}base::FilePath file_path =
base::FilePath::FromUTF8Unsafe(api_options_param.path);
if (file_path.IsNetwork()) {
paths_are_all_local = false;
break;
}
}
EXTENSION_FUNCTION_VALIDATE(paths_are_all_utf8);
EXTENSION_FUNCTION_VALIDATE(paths_are_all_local);
```
Done
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Remove the extra line, as Gerrit only processes arguments in the last paragraph.
EnterpriseReportingPrivateGetFileSystemInfoFunction::Run() {Can you add a unit test to the existing suite?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
David Baron removed Lei Zhang, Nikhil Nayunigari, Akihiro Ota, Chromium Metrics Reviews, android-bu...@system.gserviceaccount.com, Kevin McNee, Stephen Chenney, James Maclean, Fredrik Söderquist, (Julie)Jeongeun Kim, Menard, Alexis, Dirk Schulze, Nektarios Paisios, Kevin Babbitt, ortuno...@chromium.org, blink-rev...@chromium.org, blink-rev...@chromium.org, pdr+svgw...@chromium.org, blink-re...@chromium.org, feature-me...@chromium.org, ios-r...@chromium.org, yuzo+...@chromium.org, kyungjunle...@google.com, blink-...@chromium.org, asvitki...@chromium.org, blink-revi...@chromium.org, kinuko...@chromium.org, jmedle...@chromium.org, dgroga...@chromium.org, vaapi-...@chromium.org, jonmann+wa...@chromium.org, zol...@webkit.org, accessibility-a...@google.com, apavlo...@chromium.org, francisjp...@google.com, josiah...@chromium.org, drott...@chromium.org, yongshun+...@google.com, stevenjb+wa...@chromium.org, jdonnel...@chromium.org, kouhe...@chromium.org, blink-re...@chromium.org, asvitkine...@chromium.org, scheduler...@chromium.org, dbaro...@chromium.org, gavin...@chromium.org, print-revi...@chromium.org, nektar...@chromium.org, cblume...@chromium.org, oshima...@chromium.org, abigailbk...@google.com, chromeos-gfx-...@google.com, dtseng...@chromium.org, tburkar...@chromium.org, blink-rev...@chromium.org, dewitt...@chromium.org, lucasrada...@google.com, chrome-intell...@chromium.org, penghuan...@chromium.org, titoua...@chromium.org, chadduffin+w...@chromium.org, jackshira+w...@google.com, ejcaruso+wa...@chromium.org, fmalit...@chromium.org, marq+...@chromium.org, hsuregan+wa...@chromium.org, jiajunz+wa...@google.com, michaelchec...@google.com, omnibox-...@chromium.org, mac-r...@chromium.org, media-cro...@chromium.org, ios-revie...@chromium.org, ios-rev...@chromium.org, language...@chromium.org, khorimoto+w...@chromium.org and chrome-intelligence-te...@google.com from reviewers of this change.
Add path validation to prevent NTLM leak in getFileSystemInfo
This CL adds validation in the browser process to reject network paths
provided to the getFileSystemInfo API, preventing outbound SMB connections
and potential NTLM leak in the unsandboxed utility process.
Fixed: 501857663
diff --git a/chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_private_api.cc b/chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_private_api.cc
index 87f91d7..cd861c8 100644
--- a/chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_private_api.cc
+++ b/chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_private_api.cc
@@ -686,15 +686,23 @@
args());
EXTENSION_FUNCTION_VALIDATE(params);
- // Verify that all file paths are UTF8.
+ // Verify that all file paths are UTF8 and strictly local.
bool paths_are_all_utf8 = true;
+ bool paths_are_all_local = true;
for (const auto& api_options_param : params->request.options) {
if (!base::IsStringUTF8(api_options_param.path)) {
paths_are_all_utf8 = false;
break;
}
+ base::FilePath file_path =
+ base::FilePath::FromUTF8Unsafe(api_options_param.path);
+ if (file_path.IsNetwork()) {
+ paths_are_all_local = false;
+ break;
+ }
}
EXTENSION_FUNCTION_VALIDATE(paths_are_all_utf8);
+ EXTENSION_FUNCTION_VALIDATE(paths_are_all_local);
auto aggregation_request = CreateAggregationRequest(signal_name());
aggregation_request.file_system_signal_parameters =
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |