|
|
Created:
4 years, 7 months ago by Guido Urdaneta Modified:
4 years, 6 months ago Reviewers:
jam, tommi (sloooow) - chröme, Kevin M, Torne, haibinlu CC:
anandc+watch-blimp_chromium.org, android-webview-reviews_chromium.org, Avi (use Gerrit), chromium-reviews, darin-cc_chromium.org, dtrainor+watch-blimp_chromium.org, feature-media-reviews_chromium.org, haibinlu, jessicag+watch-blimp_chromium.org, jochen+watch_chromium.org, khushalsagar+watch-blimp_chromium.org, Kevin M, kmarshall+watch-blimp_chromium.org, maniscalco+watch-blimp_chromium.org, marcinjb+watch-blimp_chromium.org, mcasas+watch+vc_chromium.org, mkwst+moarreviews-shell_chromium.org, mlamouri+watch-content_chromium.org, nyquist+watch-blimp_chromium.org, Peter Beverloo, shaktisahu+watch-blimp_chromium.org, sriramsr+watch-blimp_chromium.org, tommi (sloooow) - chröme, Torne, jochen (gone - plz use gerrit) Base URL:
https://chromium.googlesource.com/chromium/src.git@master Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionThis results in different hashed device IDs on each session on embedders that don't have a specialized implementation of device ID salts such as WebView, Blimp and Content Shell. The new default helps prevent user fingerprinting on these embedders.
Since the new default logic is basically the same as for Chrome incognito mode, Chrome's implementation of salts has been updated to defer to the new default on incognito mode.
BUG=315022
Committed: https://crrev.com/4db1329e005388540eb07429ac97827ca9bc422b
Cr-Commit-Position: refs/heads/master@{#399883}
Patch Set 1 #
Total comments: 4
Patch Set 2 : tommi's comment + minor change #Patch Set 3 : reimplement using jam's proposed approach #Patch Set 4 : remove obsolete comment #Patch Set 5 : rebase + minor change #Patch Set 6 : fix compile error #Patch Set 7 : better fix for compile error #
Total comments: 2
Patch Set 8 : Replace ResourceContext::SaltCallback with std::string. #Patch Set 9 : rebase #
Total comments: 8
Patch Set 10 : jam's comments #Patch Set 11 : Fix threading error #Patch Set 12 : change return type from const string to string, as it makes no difference #Patch Set 13 : change return type from const string to string as it makes no difference #
Created: 4 years, 6 months ago
Messages
Total messages: 68 (28 generated)
Description was changed from ========== Add random media device ID salts to blimp, android webview and content shell. BUG=315022 ========== to ========== Add random media device ID salts to blimp, android webview and content shell. BUG=315022 ==========
guidou@chromium.org changed reviewers: + tommi@chromium.org
tommi: this is approach 5, as discussed in crbug.com/315022
lgtm. would like the strings to be const whenever possible. https://codereview.chromium.org/1987643002/diff/1/android_webview/browser/aw_... File android_webview/browser/aw_resource_context.h (right): https://codereview.chromium.org/1987643002/diff/1/android_webview/browser/aw_... android_webview/browser/aw_resource_context.h:39: std::string media_device_id_salt_; can this be const? https://codereview.chromium.org/1987643002/diff/1/blimp/engine/common/blimp_b... File blimp/engine/common/blimp_browser_context.cc (right): https://codereview.chromium.org/1987643002/diff/1/blimp/engine/common/blimp_b... blimp/engine/common/blimp_browser_context.cc:60: std::string media_device_id_salt_; const?
https://codereview.chromium.org/1987643002/diff/1/android_webview/browser/aw_... File android_webview/browser/aw_resource_context.h (right): https://codereview.chromium.org/1987643002/diff/1/android_webview/browser/aw_... android_webview/browser/aw_resource_context.h:39: std::string media_device_id_salt_; On 2016/05/17 12:27:19, tommi-chrömium wrote: > can this be const? Done. https://codereview.chromium.org/1987643002/diff/1/blimp/engine/common/blimp_b... File blimp/engine/common/blimp_browser_context.cc (right): https://codereview.chromium.org/1987643002/diff/1/blimp/engine/common/blimp_b... blimp/engine/common/blimp_browser_context.cc:60: std::string media_device_id_salt_; On 2016/05/17 12:27:20, tommi-chrömium wrote: > const? Done.
guidou@chromium.org changed reviewers: + avi@chromium.org, dtrainor@chromium.org, torne@chromium.org
dtrainor@chromium.org: Please review changes in blimp/ torne@chromium.org: Please review changes in android_webview/ avi@chromium.org: Please review changes in content/
guidou@chromium.org changed reviewers: - dtrainor@chromium.org
guidou@chromium.org changed reviewers: + haibinlu@chromium.org
haibinlu@chromium.org: Please review changes in blimp/
Description was changed from ========== Add random media device ID salts to blimp, android webview and content shell. BUG=315022 ========== to ========== Add random media device ID salts to blimp, android webview and content shell. This results in different random IDs on each sessions, which helps prevent user fingerprinting. BUG=315022 ==========
Description was changed from ========== Add random media device ID salts to blimp, android webview and content shell. This results in different random IDs on each sessions, which helps prevent user fingerprinting. BUG=315022 ========== to ========== Add random media device ID salts to blimp, android webview and content shell. This results in different hashed device IDs on each session, which helps prevent user fingerprinting. BUG=315022 ==========
haibinlu@chromium.org: Please review changes in blimp/
android_webview LGTM - thanks for the simpler approach here! :)
avi@chromium.org changed reviewers: + jam@chromium.org
John, do you know about ResourceContext? It's not clear to me why this complicated dance is going on. The original code says that we need to save this salt to the user profile (see resource_context.h line 59), but this CL talks about changing it to be per-session, which seems to contradict that comment. Are we making this per-session? I've read the five approaches listed in the bug and it's still not clear to me what's going on.
On 2016/05/18 15:15:16, Avi wrote: > John, do you know about ResourceContext? > > It's not clear to me why this complicated dance is going on. The original code > says that we need to save this salt to the user profile (see resource_context.h > line 59), but this CL talks about changing it to be per-session, which seems to > contradict that comment. > > Are we making this per-session? I've read the five approaches listed in the bug > and it's still not clear to me what's going on. This salt is used to hash media device IDs when they are reported to the renderer process. The purpose of this hashing is to prevent sites from fingerprinting users by looking at the devices that users have available locally. Hashed device IDs in chrome are the result of a hash of the real ID, the security origin, and a random salt. The salt is stored in the preferences of the profile, so the device IDs are the same in future sessions with the same profile and origin. Other embedders like Blimp, WebView and Content Shell use hash(real_id, security_origin, empty string), which makes fingerprinting easy. WebView and Blimp have preferences, so they could follow the same approach as Chrome. https://codereview.chromium.org/1981913002/ (not landed) does that with WebView. However, WebView and Blimp do not persist their preferences, so the salt would be forgotten if stored in preferences. For these embedders, store the salt in a field is simpler and gives the same results. The disadvantage is that hashed device IDs will change in every session, but that is preferable to having them easier to fingerprint. Note however, I'll be glad to follow your advice on how to proceed in this matter.
On 2016/05/18 15:34:39, Guido Urdaneta wrote: > On 2016/05/18 15:15:16, Avi wrote: > > John, do you know about ResourceContext? > > > > It's not clear to me why this complicated dance is going on. The original code > > says that we need to save this salt to the user profile (see > resource_context.h > > line 59), but this CL talks about changing it to be per-session, which seems > to > > contradict that comment. > > > > Are we making this per-session? I've read the five approaches listed in the > bug > > and it's still not clear to me what's going on. > > This salt is used to hash media device IDs when they are reported to the > renderer process. > The purpose of this hashing is to prevent sites from fingerprinting users by > looking at the devices that users have available locally. > Hashed device IDs in chrome are the result of a hash of the real ID, the > security origin, and a random salt. The salt is stored in the preferences of > the profile, so the device IDs are the same in future sessions with the same > profile and origin. > > Other embedders like Blimp, WebView and Content Shell use hash(real_id, > security_origin, empty string), which makes fingerprinting easy. > WebView and Blimp have preferences, so they could follow the same approach as > Chrome. https://codereview.chromium.org/1981913002/ (not landed) does that with > WebView. > > However, WebView and Blimp do not persist their preferences, so the salt would > be forgotten if stored in preferences. For these embedders, store the salt in a > field is simpler and gives the same results. > The disadvantage is that hashed device IDs will change in every session, but > that is preferable to having them easier to fingerprint. > > Note however, I'll be glad to follow your advice on how to proceed in this > matter. Thanks for the explanations. Few comments: -why is ResourceContext::GetMediaDeviceIDSalt asynchronous? it looks like the chrome implementation can return the salt synchronously. -a general pattern that we use for stuff like this is that the default implementation of GetMediaDeviceIDSalt can have the code to return the random string. then blimp/webview/content_shell don't have to override it and you don't need to expose new methods in resource_context.h. any reason why that wouldn't work here? -chrome's ResourceContext's implementation can still call the parent class' method to get a default string, which it can use if the pref wasn't set or if it's in incognito.
kmarshall@chromium.org changed reviewers: + kmarshall@chromium.org
blimp lgtm
Description was changed from ========== Add random media device ID salts to blimp, android webview and content shell. This results in different hashed device IDs on each session, which helps prevent user fingerprinting. BUG=315022 ========== to ========== This results in different hashed device IDs on each session, which helps prevent user fingerprinting. Also remove incognito logic from chrome's implementation as it can now rely on the default implementation for incognito mode. BUG=315022 ==========
On 2016/05/18 16:19:22, jam OOO wrote: > On 2016/05/18 15:34:39, Guido Urdaneta wrote: > > On 2016/05/18 15:15:16, Avi wrote: > > > John, do you know about ResourceContext? > > > > > > It's not clear to me why this complicated dance is going on. The original > code > > > says that we need to save this salt to the user profile (see > > resource_context.h > > > line 59), but this CL talks about changing it to be per-session, which seems > > to > > > contradict that comment. > > > > > > Are we making this per-session? I've read the five approaches listed in the > > bug > > > and it's still not clear to me what's going on. > > > > This salt is used to hash media device IDs when they are reported to the > > renderer process. > > The purpose of this hashing is to prevent sites from fingerprinting users by > > looking at the devices that users have available locally. > > Hashed device IDs in chrome are the result of a hash of the real ID, the > > security origin, and a random salt. The salt is stored in the preferences of > > the profile, so the device IDs are the same in future sessions with the same > > profile and origin. > > > > Other embedders like Blimp, WebView and Content Shell use hash(real_id, > > security_origin, empty string), which makes fingerprinting easy. > > WebView and Blimp have preferences, so they could follow the same approach as > > Chrome. https://codereview.chromium.org/1981913002/ (not landed) does that > with > > WebView. > > > > However, WebView and Blimp do not persist their preferences, so the salt would > > be forgotten if stored in preferences. For these embedders, store the salt in > a > > field is simpler and gives the same results. > > The disadvantage is that hashed device IDs will change in every session, but > > that is preferable to having them easier to fingerprint. > > > > Note however, I'll be glad to follow your advice on how to proceed in this > > matter. > > Thanks for the explanations. Few comments: > -why is ResourceContext::GetMediaDeviceIDSalt asynchronous? it looks like the > chrome implementation can return the salt synchronously. I guess the reason the salt is returned as a callback is to give embedders more flexibility. > -a general pattern that we use for stuff like this is that the default > implementation of GetMediaDeviceIDSalt can have the code to return the random > string. then blimp/webview/content_shell don't have to override it and you don't > need to expose new methods in resource_context.h. any reason why that wouldn't > work here? > -chrome's ResourceContext's implementation can still call the parent class' > method to get a default string, which it can use if the pref wasn't set or if > it's in incognito. My main concern about doing it this is adding a field to a class that was originally intended to have only pure virtual methods. Despite that, I think it's the simplest approach. I just implemented it that way. Please let me know what you think.
lgtm
+jochen: can you take a look?
The CQ bit was checked by guidou@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1987643002/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1987643002/80001
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: chromeos_amd64-generic_chromium_compile_only_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromeos_amd64-...) chromeos_x86-generic_chromium_compile_only_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromeos_x86-ge...)
The CQ bit was checked by guidou@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1987643002/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1987643002/100001
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_android_rel_ng on tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_androi...)
The CQ bit was checked by guidou@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1987643002/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1987643002/120001
Patchset #7 (id:120001) has been deleted
jochen@chromium.org changed reviewers: + haibinlu@chromium.org, kmarshall@chromium.org, tommi@chromium.org, torne@chromium.org
https://codereview.chromium.org/1987643002/diff/140001/content/public/browser... File content/public/browser/resource_context.h (right): https://codereview.chromium.org/1987643002/diff/140001/content/public/browser... content/public/browser/resource_context.h:79: static std::string CreateRandomMediaDeviceIDSalt(); as jam@ pointed out, you don't need to expose this method, embedders can just call ResourceContext::GetMediaDeviceIDSalt()
https://codereview.chromium.org/1987643002/diff/140001/content/public/browser... File content/public/browser/resource_context.h (right): https://codereview.chromium.org/1987643002/diff/140001/content/public/browser... content/public/browser/resource_context.h:79: static std::string CreateRandomMediaDeviceIDSalt(); On 2016/06/03 12:50:25, jochen wrote: > as jam@ pointed out, you don't need to expose this method, embedders can just > call ResourceContext::GetMediaDeviceIDSalt() The MediaDeviceIDSalt class uses that method to generate a random salt and store it in preferences. This class does not know about ResourceContext, but it's used by the profile implementation of ResourceContext. If we don't expose it we need either to duplicate the method in MediaDeviceIDSalt or do some less trivial refactoring in order to reuse the ResourceContext method. Since the utility method is almost a one-liner it's not such a big deal to duplicate it. Are you OK with this?
On 2016/06/03 at 13:09:44, guidou wrote: > https://codereview.chromium.org/1987643002/diff/140001/content/public/browser... > File content/public/browser/resource_context.h (right): > > https://codereview.chromium.org/1987643002/diff/140001/content/public/browser... > content/public/browser/resource_context.h:79: static std::string CreateRandomMediaDeviceIDSalt(); > On 2016/06/03 12:50:25, jochen wrote: > > as jam@ pointed out, you don't need to expose this method, embedders can just > > call ResourceContext::GetMediaDeviceIDSalt() > > The MediaDeviceIDSalt class uses that method to generate a random salt and store it in preferences. This class does not know about ResourceContext, but it's used by the profile implementation of ResourceContext. > > If we don't expose it we need either to duplicate the method in MediaDeviceIDSalt or do some less trivial refactoring in order to reuse the ResourceContext method. > Since the utility method is almost a one-liner it's not such a big deal to duplicate it. Are you OK with this? what about instantiating the media device id salt also for incognito mode? shouldn't the incognito pref service just not persist the pref?
On 2016/06/03 at 13:09:44, guidou wrote: > https://codereview.chromium.org/1987643002/diff/140001/content/public/browser... > File content/public/browser/resource_context.h (right): > > https://codereview.chromium.org/1987643002/diff/140001/content/public/browser... > content/public/browser/resource_context.h:79: static std::string CreateRandomMediaDeviceIDSalt(); > On 2016/06/03 12:50:25, jochen wrote: > > as jam@ pointed out, you don't need to expose this method, embedders can just > > call ResourceContext::GetMediaDeviceIDSalt() > > The MediaDeviceIDSalt class uses that method to generate a random salt and store it in preferences. This class does not know about ResourceContext, but it's used by the profile implementation of ResourceContext. > > If we don't expose it we need either to duplicate the method in MediaDeviceIDSalt or do some less trivial refactoring in order to reuse the ResourceContext method. > Since the utility method is almost a one-liner it's not such a big deal to duplicate it. Are you OK with this? what about instantiating the media device id salt also for incognito mode? shouldn't the incognito pref service just not persist the pref?
> what about instantiating the media device id salt also for incognito mode? > shouldn't the incognito pref service just not persist the pref? The problem with that is that, AFAIK, there is no standardized way to get the PrefService in content. All uses of a PrefService are specific to each embedder. Another option could be to move MediaDeviceIDSalt to components, and expose the static method to produce a salt string there.
On 2016/06/08 at 09:52:03, guidou wrote: > > what about instantiating the media device id salt also for incognito mode? > > shouldn't the incognito pref service just not persist the pref? > > The problem with that is that, AFAIK, there is no standardized way to get the PrefService in content. > All uses of a PrefService are specific to each embedder. > Another option could be to move MediaDeviceIDSalt to components, and expose the static method to produce a salt string there. no, I meant for the profile_io_data, we currently use a static hash for OTR (or after your change, don't create a MediaDeviceIDSalt at all). Why not just always create one there?
On 2016/06/08 15:04:16, jochen wrote: > On 2016/06/08 at 09:52:03, guidou wrote: > > > what about instantiating the media device id salt also for incognito mode? > > > shouldn't the incognito pref service just not persist the pref? > > > > The problem with that is that, AFAIK, there is no standardized way to get the > PrefService in content. > > All uses of a PrefService are specific to each embedder. > > Another option could be to move MediaDeviceIDSalt to components, and expose > the static method to produce a salt string there. > > no, I meant for the profile_io_data, we currently use a static hash for OTR (or > after your change, don't create a MediaDeviceIDSalt at all). Why not just always > create one there? I believe the reason is that the OTR pref service starts out with the same values as the original profile. I tried always creating the MediaDeviceIDSalt and in incognito mode the salt was already present in the pref service, thus producing the same device IDs. Using profile->GetOffTheRecordPrefs() in OTR mode makes no difference either.
On 2016/05/18 18:32:43, Guido Urdaneta wrote: > On 2016/05/18 16:19:22, jam OOO wrote: > > On 2016/05/18 15:34:39, Guido Urdaneta wrote: > > > On 2016/05/18 15:15:16, Avi wrote: > > > > John, do you know about ResourceContext? > > > > > > > > It's not clear to me why this complicated dance is going on. The original > > code > > > > says that we need to save this salt to the user profile (see > > > resource_context.h > > > > line 59), but this CL talks about changing it to be per-session, which > seems > > > to > > > > contradict that comment. > > > > > > > > Are we making this per-session? I've read the five approaches listed in > the > > > bug > > > > and it's still not clear to me what's going on. > > > > > > This salt is used to hash media device IDs when they are reported to the > > > renderer process. > > > The purpose of this hashing is to prevent sites from fingerprinting users by > > > looking at the devices that users have available locally. > > > Hashed device IDs in chrome are the result of a hash of the real ID, the > > > security origin, and a random salt. The salt is stored in the preferences > of > > > the profile, so the device IDs are the same in future sessions with the same > > > profile and origin. > > > > > > Other embedders like Blimp, WebView and Content Shell use hash(real_id, > > > security_origin, empty string), which makes fingerprinting easy. > > > WebView and Blimp have preferences, so they could follow the same approach > as > > > Chrome. https://codereview.chromium.org/1981913002/ (not landed) does that > > with > > > WebView. > > > > > > However, WebView and Blimp do not persist their preferences, so the salt > would > > > be forgotten if stored in preferences. For these embedders, store the salt > in > > a > > > field is simpler and gives the same results. > > > The disadvantage is that hashed device IDs will change in every session, but > > > that is preferable to having them easier to fingerprint. > > > > > > Note however, I'll be glad to follow your advice on how to proceed in this > > > matter. > > > > Thanks for the explanations. Few comments: > > -why is ResourceContext::GetMediaDeviceIDSalt asynchronous? it looks like the > > chrome implementation can return the salt synchronously. > > I guess the reason the salt is returned as a callback is to give embedders more > flexibility. Let's add flexibility when we need it. But until then, no need to complicate the api further. > > > > -a general pattern that we use for stuff like this is that the default > > implementation of GetMediaDeviceIDSalt can have the code to return the random > > string. then blimp/webview/content_shell don't have to override it and you > don't > > need to expose new methods in resource_context.h. any reason why that wouldn't > > work here? > > -chrome's ResourceContext's implementation can still call the parent class' > > method to get a default string, which it can use if the pref wasn't set or if > > it's in incognito. > > My main concern about doing it this is adding a field to a class that was > originally intended to have only pure virtual methods. field? i meant that ResourceContext's GetMediaDeviceIDSalt() would have a default implementation. it's already not pure. > Despite that, I think it's the simplest approach. > I just implemented it that way. Please let me know what you think.
On 2016/06/09 15:52:29, jam wrote: > On 2016/05/18 18:32:43, Guido Urdaneta wrote: > > On 2016/05/18 16:19:22, jam OOO wrote: > > > On 2016/05/18 15:34:39, Guido Urdaneta wrote: > > > > On 2016/05/18 15:15:16, Avi wrote: > > > > > John, do you know about ResourceContext? > > > > > > > > > > It's not clear to me why this complicated dance is going on. The > original > > > code > > > > > says that we need to save this salt to the user profile (see > > > > resource_context.h > > > > > line 59), but this CL talks about changing it to be per-session, which > > seems > > > > to > > > > > contradict that comment. > > > > > > > > > > Are we making this per-session? I've read the five approaches listed in > > the > > > > bug > > > > > and it's still not clear to me what's going on. > > > > > > > > This salt is used to hash media device IDs when they are reported to the > > > > renderer process. > > > > The purpose of this hashing is to prevent sites from fingerprinting users > by > > > > looking at the devices that users have available locally. > > > > Hashed device IDs in chrome are the result of a hash of the real ID, the > > > > security origin, and a random salt. The salt is stored in the preferences > > of > > > > the profile, so the device IDs are the same in future sessions with the > same > > > > profile and origin. > > > > > > > > Other embedders like Blimp, WebView and Content Shell use hash(real_id, > > > > security_origin, empty string), which makes fingerprinting easy. > > > > WebView and Blimp have preferences, so they could follow the same approach > > as > > > > Chrome. https://codereview.chromium.org/1981913002/ (not landed) does that > > > with > > > > WebView. > > > > > > > > However, WebView and Blimp do not persist their preferences, so the salt > > would > > > > be forgotten if stored in preferences. For these embedders, store the salt > > in > > > a > > > > field is simpler and gives the same results. > > > > The disadvantage is that hashed device IDs will change in every session, > but > > > > that is preferable to having them easier to fingerprint. > > > > > > > > Note however, I'll be glad to follow your advice on how to proceed in this > > > > matter. > > > > > > Thanks for the explanations. Few comments: > > > -why is ResourceContext::GetMediaDeviceIDSalt asynchronous? it looks like > the > > > chrome implementation can return the salt synchronously. > > > > I guess the reason the salt is returned as a callback is to give embedders > more > > flexibility. > > Let's add flexibility when we need it. But until then, no need to complicate the > api further. > I agree. Should we change the API to return a string? I would prefer do that in an upcoming CL since that would require changes in a lot of places that use the callback. In the meantime I can add a TODO. Would that be OK with you? > > My main concern about doing it this is adding a field to a class that was > > originally intended to have only pure virtual methods. > > field? i meant that ResourceContext's GetMediaDeviceIDSalt() would have a > default implementation. it's already not pure. > The current default implementation returns the empty string (well, a callback that returns an empty string). We want to change it to return a random string, but it has to be the same random string on every call to ResourceContext::GetMediaDeviceIDSalt. The field is to store that random string. Do you have a different implementation strategy in mind?
(sorry for delay, I missed the earlier comment) On 2016/06/09 16:07:13, Guido Urdaneta wrote: > On 2016/06/09 15:52:29, jam wrote: > > On 2016/05/18 18:32:43, Guido Urdaneta wrote: > > > On 2016/05/18 16:19:22, jam OOO wrote: > > > > On 2016/05/18 15:34:39, Guido Urdaneta wrote: > > > > > On 2016/05/18 15:15:16, Avi wrote: > > > > > > John, do you know about ResourceContext? > > > > > > > > > > > > It's not clear to me why this complicated dance is going on. The > > original > > > > code > > > > > > says that we need to save this salt to the user profile (see > > > > > resource_context.h > > > > > > line 59), but this CL talks about changing it to be per-session, which > > > seems > > > > > to > > > > > > contradict that comment. > > > > > > > > > > > > Are we making this per-session? I've read the five approaches listed > in > > > the > > > > > bug > > > > > > and it's still not clear to me what's going on. > > > > > > > > > > This salt is used to hash media device IDs when they are reported to the > > > > > renderer process. > > > > > The purpose of this hashing is to prevent sites from fingerprinting > users > > by > > > > > looking at the devices that users have available locally. > > > > > Hashed device IDs in chrome are the result of a hash of the real ID, the > > > > > security origin, and a random salt. The salt is stored in the > preferences > > > of > > > > > the profile, so the device IDs are the same in future sessions with the > > same > > > > > profile and origin. > > > > > > > > > > Other embedders like Blimp, WebView and Content Shell use hash(real_id, > > > > > security_origin, empty string), which makes fingerprinting easy. > > > > > WebView and Blimp have preferences, so they could follow the same > approach > > > as > > > > > Chrome. https://codereview.chromium.org/1981913002/ (not landed) does > that > > > > with > > > > > WebView. > > > > > > > > > > However, WebView and Blimp do not persist their preferences, so the salt > > > would > > > > > be forgotten if stored in preferences. For these embedders, store the > salt > > > in > > > > a > > > > > field is simpler and gives the same results. > > > > > The disadvantage is that hashed device IDs will change in every session, > > but > > > > > that is preferable to having them easier to fingerprint. > > > > > > > > > > Note however, I'll be glad to follow your advice on how to proceed in > this > > > > > matter. > > > > > > > > Thanks for the explanations. Few comments: > > > > -why is ResourceContext::GetMediaDeviceIDSalt asynchronous? it looks like > > the > > > > chrome implementation can return the salt synchronously. > > > > > > I guess the reason the salt is returned as a callback is to give embedders > > more > > > flexibility. > > > > Let's add flexibility when we need it. But until then, no need to complicate > the > > api further. > > > > I agree. Should we change the API to return a string? > I would prefer do that in an upcoming CL since that would require changes in a > lot of places that use the callback. > In the meantime I can add a TODO. Would that be OK with you? Let's do it here. There aren't that many places (only 11 hits total for GetMediaDeviceIDSalt) > > > > > > My main concern about doing it this is adding a field to a class that was > > > originally intended to have only pure virtual methods. > > > > field? i meant that ResourceContext's GetMediaDeviceIDSalt() would have a > > default implementation. it's already not pure. > > > > The current default implementation returns the empty string (well, a callback > that returns an empty string). > We want to change it to return a random string, but it has to be the same random > string on every call to ResourceContext::GetMediaDeviceIDSalt. > The field is to store that random string. Do you have a different implementation > strategy in mind? I understand chrome's implementation does that, but the others (content_shell etc) aren't. So I'm not seeing how that changes the default implementation (which doesn't need to do this)?
guidou@chromium.org changed reviewers: - haibinlu@chromium.org, jochen@chromium.org, kmarshall@chromium.org, tommi@chromium.org, torne@chromium.org
> Let's do it here. There aren't that many places (only 11 hits total for > GetMediaDeviceIDSalt) > Done. > > The current default implementation returns the empty string (well, a callback > > that returns an empty string). > > We want to change it to return a random string, but it has to be the same > random > > string on every call to ResourceContext::GetMediaDeviceIDSalt. > > The field is to store that random string. Do you have a different > implementation > > strategy in mind? > > I understand chrome's implementation does that, but the others (content_shell > etc) aren't. So I'm not seeing how that changes the default implementation > (which doesn't need to do this)? The goal of this CL to change all implementations of ResourceContext to return a salt consisting of random string instead of the empty string. Note that for a given ResourceContext, multiple calls to GetMediaDeviceIDSalt() should always return the same (randomly generated) string. In a previous comment you suggested the following: > -a general pattern that we use for stuff like this is that the default > implementation of GetMediaDeviceIDSalt can have the code to return the random > string. then blimp/webview/content_shell don't have to override it and you don't > need to expose new methods in resource_context.h. any reason why that wouldn't > work here? > -chrome's ResourceContext's implementation can still call the parent class' > method to get a default string, which it can use if the pref wasn't set or if > it's in incognito. The latest patchset has an implementation of this idea. The only caveat is that it exposes a static CreateRandomMediaDeviceIDSalt() utility method in ResourceContext (the old MediaDeviceIDSalt::CreateSalt()). It's practically a one-liner so we can instead duplicate it in MediaDeviceIDSalt if you think that's better. Note that just calling content::ResourceContext::GetMediaDeviceIDSalt() to get a random salt would not work for the MediaDeviceIDSalt::Reset() method, since it must ensure a new (different) salt is stored in the preferences.
https://codereview.chromium.org/1987643002/diff/180001/chrome/browser/media/m... File chrome/browser/media/media_device_id_salt.cc (right): https://codereview.chromium.org/1987643002/diff/180001/chrome/browser/media/m... chrome/browser/media/media_device_id_salt.cc:20: if (media_device_id_salt_.GetValue().empty()) { i'm confused, the cl description says "This results in different hashed device IDs on each session, which helps prevent user fingerprinting." which I understood to mean that there is a different salt each time chrome starts. am i understanding correctly? If so, then how come the salt is saved in prefs? https://codereview.chromium.org/1987643002/diff/180001/content/browser/resour... File content/browser/resource_context_impl.cc (right): https://codereview.chromium.org/1987643002/diff/180001/content/browser/resour... content/browser/resource_context_impl.cc:9: #include <string> nit: no need to add, this is in the header https://codereview.chromium.org/1987643002/diff/180001/content/public/browser... File content/public/browser/resource_context.h (right): https://codereview.chromium.org/1987643002/diff/180001/content/public/browser... content/public/browser/resource_context.h:58: // The salt should be stored in the current user profile and should be reset nit: don't mention user profile, since that's a chrome concept https://codereview.chromium.org/1987643002/diff/180001/content/public/browser... content/public/browser/resource_context.h:62: // Utility function useful for implementations nit: make it explicit that this only needs to be called if 1) the embedder needs to use a new salt 2) the embedder saves its salt across restart
lgtm Guido clarified over IM that this is for blimp/content_shell/webview and will update the description.
Description was changed from ========== This results in different hashed device IDs on each session, which helps prevent user fingerprinting. Also remove incognito logic from chrome's implementation as it can now rely on the default implementation for incognito mode. BUG=315022 ========== to ========== This results in different hashed device IDs on each session on embedders that don't have a specialized implementation of device ID salts. This helps prevent user fingerprinting on these embedders. Since the new default logic is basically the same as for Chrome incognito mode, Chrome's implementation of salts has been updated to defer to the new default on incognito mode. BUG=315022 ==========
Description was changed from ========== This results in different hashed device IDs on each session on embedders that don't have a specialized implementation of device ID salts. This helps prevent user fingerprinting on these embedders. Since the new default logic is basically the same as for Chrome incognito mode, Chrome's implementation of salts has been updated to defer to the new default on incognito mode. BUG=315022 ========== to ========== This results in different hashed device IDs on each session on embedders that don't have a specialized implementation of device ID salts such as WebView, Blimp and Content Shell. The new default helps prevent user fingerprinting on these embedders. Since the new default logic is basically the same as for Chrome incognito mode, Chrome's implementation of salts has been updated to defer to the new default on incognito mode. BUG=315022 ==========
https://codereview.chromium.org/1987643002/diff/180001/chrome/browser/media/m... File chrome/browser/media/media_device_id_salt.cc (right): https://codereview.chromium.org/1987643002/diff/180001/chrome/browser/media/m... chrome/browser/media/media_device_id_salt.cc:20: if (media_device_id_salt_.GetValue().empty()) { On 2016/06/14 16:20:33, jam wrote: > i'm confused, the cl description says "This results in different hashed device > IDs on each session, which helps prevent user fingerprinting." which I > understood to mean that there is a different salt each time chrome starts. am i > understanding correctly? If so, then how come the salt is saved in prefs? Clarified via IM and in the updated CL description. https://codereview.chromium.org/1987643002/diff/180001/content/browser/resour... File content/browser/resource_context_impl.cc (right): https://codereview.chromium.org/1987643002/diff/180001/content/browser/resour... content/browser/resource_context_impl.cc:9: #include <string> On 2016/06/14 16:20:33, jam wrote: > nit: no need to add, this is in the header Done. https://codereview.chromium.org/1987643002/diff/180001/content/public/browser... File content/public/browser/resource_context.h (right): https://codereview.chromium.org/1987643002/diff/180001/content/public/browser... content/public/browser/resource_context.h:58: // The salt should be stored in the current user profile and should be reset On 2016/06/14 16:20:33, jam wrote: > nit: don't mention user profile, since that's a chrome concept Done. https://codereview.chromium.org/1987643002/diff/180001/content/public/browser... content/public/browser/resource_context.h:62: // Utility function useful for implementations On 2016/06/14 16:20:33, jam wrote: > nit: make it explicit that this only needs to be called if > 1) the embedder needs to use a new salt > 2) the embedder saves its salt across restart Done.
The CQ bit was checked by guidou@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from tommi@chromium.org, torne@chromium.org, kmarshall@chromium.org, haibinlu@chromium.org, jam@chromium.org Link to the patchset: https://codereview.chromium.org/1987643002/#ps200001 (title: "jam's comments")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1987643002/200001
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: mac_chromium_gn_rel on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_gn_r...)
The CQ bit was checked by guidou@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from jam@chromium.org, tommi@chromium.org, kmarshall@chromium.org, torne@chromium.org, haibinlu@chromium.org Link to the patchset: https://codereview.chromium.org/1987643002/#ps260001 (title: "change return type from const string to string as it makes no difference")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1987643002/260001
Message was sent while issue was closed.
Description was changed from ========== This results in different hashed device IDs on each session on embedders that don't have a specialized implementation of device ID salts such as WebView, Blimp and Content Shell. The new default helps prevent user fingerprinting on these embedders. Since the new default logic is basically the same as for Chrome incognito mode, Chrome's implementation of salts has been updated to defer to the new default on incognito mode. BUG=315022 ========== to ========== This results in different hashed device IDs on each session on embedders that don't have a specialized implementation of device ID salts such as WebView, Blimp and Content Shell. The new default helps prevent user fingerprinting on these embedders. Since the new default logic is basically the same as for Chrome incognito mode, Chrome's implementation of salts has been updated to defer to the new default on incognito mode. BUG=315022 ==========
Message was sent while issue was closed.
Committed patchset #13 (id:260001)
Message was sent while issue was closed.
CQ bit was unchecked
Message was sent while issue was closed.
Description was changed from ========== This results in different hashed device IDs on each session on embedders that don't have a specialized implementation of device ID salts such as WebView, Blimp and Content Shell. The new default helps prevent user fingerprinting on these embedders. Since the new default logic is basically the same as for Chrome incognito mode, Chrome's implementation of salts has been updated to defer to the new default on incognito mode. BUG=315022 ========== to ========== This results in different hashed device IDs on each session on embedders that don't have a specialized implementation of device ID salts such as WebView, Blimp and Content Shell. The new default helps prevent user fingerprinting on these embedders. Since the new default logic is basically the same as for Chrome incognito mode, Chrome's implementation of salts has been updated to defer to the new default on incognito mode. BUG=315022 Committed: https://crrev.com/4db1329e005388540eb07429ac97827ca9bc422b Cr-Commit-Position: refs/heads/master@{#399883} ==========
Message was sent while issue was closed.
Patchset 13 (id:??) landed as https://crrev.com/4db1329e005388540eb07429ac97827ca9bc422b Cr-Commit-Position: refs/heads/master@{#399883}
Message was sent while issue was closed.
A revert of this CL (patchset #13 id:260001) has been created in https://codereview.chromium.org/2065383003/ by guidou@chromium.org. The reason for reverting is: Reverting because it is breaking the WebRTC MacTester bot. https://build.chromium.org/p/chromium.webrtc/builders/Mac%20Tester/builds/55969/. |