New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 923523 link

Starred by 2 users

Issue metadata

Status: Started
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Chrome , Mac , Fuchsia
Pri: 2
Type: Bug



Sign in to add a comment

--disable-web-security not completely locked to --user-data-dir

Project Member Reported by a...@chromium.org, Jan 18 (4 days ago)

Issue description

https://codereview.chromium.org/1512843002 attempted to lock --disable-web-security to --user-data-dir, but it didn't succeed.

Yes, ChromeContentBrowserClient::OverrideWebkitPrefs() now only sets WebPreferences::web_security_enabled to false if --user-data-dir is also set, buuuut *lots* of other places in the code *also* disable important security measures when --disable-web-security is used. And they *don't* check for --user-data-dir.

A search, https://cs.chromium.org/chromium/src/content/public/common/content_switches.cc?l=297&gs=kythe%253A%252F%252Fchromium%253Flang%253Dc%25252B%25252B%253Fpath%253Dsrc%252Fcontent%252Fpublic%252Fcommon%252Fcontent_switches.cc%2523yzLDik12y7C3QDFOB0AjN1JrDkgbZZ9tl%25252BCcVxrx070%25253D&gsn=kDisableWebSecurity&ct=xref_usages , finds that --disable-web-security is used to gate, in non-test code:

- CORS (content/browser/file_url_loader_factory.cc and others)
- origin checking (content/browser/frame_host/render_frame_host_impl.cc)
- CORB (content/browser/loader/cross_site_document_resource_handler.cc)
- origin checking in service workers (content/common/service_worker/service_worker_utils.cc)

and other places I don't understand. Clearly those people thought reading the switch was adequate, and it's not fair to blame them.

I see the only reasonable way forward to be *removing* the switch, so that future developers don't accidentally bump into this.
 

Sign in to add a comment