Closed Bug 1875313 Opened 2 years ago Closed 2 years ago

Spoof English is ignored in number validation

Categories

(Core :: Privacy: Anti-Tracking, defect, P3)

defect

Tracking

()

RESOLVED FIXED
124 Branch
Tracking Status
firefox124 --- fixed

People

(Reporter: pierov, Assigned: pierov)

Details

(Keywords: privacy, Whiteboard: [fingerprinting])

Attachments

(1 file)

The form validation message FormValidationStepMismatch will leak formatted numbers in certain languages (such as ar) even when spoof English is enabled (and after Bug 1875306 is fixed, also a few other strings will do it).
I think the reason is that ICUUtils::LanguageTagIterForContent takes GetAppLocaleAsBCP47 as a fallback without checking spoof English.
Input number seems to be the only consumer of that API, and it's used also for inputs (which I haven't tested after the fix).

Steps to reproduce:

  1. set your language to ar or some other language that doesn't use Arabic numbers and tell Firefox to spoof English
  2. go to https://arkenfox.github.io/TZP/tests/applang.html
  3. click on run
  4. check StepMismatch and see it leaks localized numbers
  5. check also NumberRangeOverflow and NumberRangeUnderflow: they don't leak because of Bug 1875306
Group: core-security → dom-core-security

set your language to ar or some other language that doesn't use Arabic numbers

set your language to ar or some other language that doesn't use Arabic latn numbers

FWIW, it also exposes decimal separator differences, so we're not limited to non-latn numberingSystems

  • ca
    • "Seleccioneu un valor vàlid. Els dos valors vàlids més propers són 1,2345 i 1006,789."
  • ca + spoof english
    • "Please select a valid value. The two nearest valid values are 1,2345 and 1006,789."
  • en-US
    • "Please select a valid value. The two nearest valid values are 1.2345 and 1006.789."
Attachment #9373523 - Attachment description: Bug 1875313 - Use en-US as a fallback when spoof English is enabled in ICUUtils. r?timhuang → Bug 1875313 - Use en-US as a fallback when spoof English is enabled in ICUUtils. r?timhuang,tjr
Severity: -- → S3
Priority: -- → P3

Tom: does this bug need to remain hidden? Seems more of a fingerprinting issue than a security one

Flags: needinfo?(tom)
Keywords: privacy
Whiteboard: [fingerprinting]

I suppose not

Group: dom-core-security
Flags: needinfo?(tom)
Pushed by tritter@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/c3355d01fddd Use en-US as a fallback when spoof English is enabled in ICUUtils. r=timhuang,tjr

Backed out for causing build bustages on CUUtils.cpp.

[task 2024-01-31T17:14:16.275Z] 17:14:16     INFO -  gmake[4]: Entering directory '/builds/worker/workspace/obj-build/intl/unicharutil/util'
[task 2024-01-31T17:14:16.278Z] 17:14:16     INFO -  /builds/worker/fetches/sccache/sccache /builds/worker/fetches/clang/bin/clang++ --sysroot /builds/worker/fetches/sysroot-x86_64-linux-gnu -o Unified_cpp_unicharutil_util0.o -c  -I/builds/worker/workspace/obj-build/dist/stl_wrappers -I/builds/worker/workspace/obj-build/dist/system_wrappers -include /builds/worker/checkouts/gecko/config/gcc_hidden.h -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fstack-clash-protection -ftrivial-auto-var-init=pattern -DDEBUG=1 -DMOZ_HAS_MOZGLUE -DMOZILLA_INTERNAL_API -DIMPL_LIBXUL -DSTATIC_EXPORTABLE_JS_API -I/builds/worker/checkouts/gecko/intl/unicharutil/util -I/builds/worker/workspace/obj-build/intl/unicharutil/util -I/builds/worker/workspace/obj-build/ipc/ipdl/_ipdlheaders -I/builds/worker/checkouts/gecko/ipc/chromium/src -I/builds/worker/workspace/obj-build/dist/include -I/builds/worker/workspace/obj-build/dist/include/nspr -I/builds/worker/workspace/obj-build/dist/include/nss -DMOZILLA_CLIENT -include /builds/worker/workspace/obj-build/mozilla-config.h -D_GLIBCXX_USE_CXX11_ABI=0 -fno-sized-deallocation -fno-aligned-new -fcrash-diagnostics-dir=/builds/worker/artifacts -fno-exceptions -fPIC -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -fno-math-errno -pthread -pipe -gdwarf-4 -Xclang -load -Xclang /builds/worker/workspace/obj-build/build/clang-plugin/libclang-plugin.so -Xclang -add-plugin -Xclang moz-check -O2 -fno-omit-frame-pointer -funwind-tables -Werror -Wall -Wbitfield-enum-conversion -Wdeprecated-this-capture -Wempty-body -Wformat-type-confusion -Wignored-qualifiers -Wpointer-arith -Wshadow-field-in-constructor-modified -Wsign-compare -Wtautological-constant-in-range-compare -Wtype-limits -Wno-error=tautological-type-limit-compare -Wunreachable-code -Wunreachable-code-return -Wunused-but-set-parameter -Wno-invalid-offsetof -Wclass-varargs -Wempty-init-stmt -Wfloat-overflow-conversion -Wfloat-zero-conversion -Wloop-analysis -Wno-range-loop-analysis -Wc++2a-compat -Wenum-compare-conditional -Wenum-float-conversion -Wno-error=deprecated -Wno-error=deprecated-anon-enum-enum-conversion -Wno-error=deprecated-enum-enum-conversion -Wno-error=deprecated-pragma -Wno-error=deprecated-this-capture -Wcomma -Wimplicit-fallthrough -Wstring-conversion -Wno-inline-new-delete -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=free-nonheap-object -Wno-error=atomic-alignment -Wno-error=deprecated-builtins -Wformat -Wformat-security -Wno-psabi -Wthread-safety -Wno-error=builtin-macro-redefined -Wno-unknown-warning-option -fno-strict-aliasing -ffp-contract=off  -MD -MP -MF .deps/Unified_cpp_unicharutil_util0.o.pp   Unified_cpp_unicharutil_util0.cpp
[task 2024-01-31T17:14:16.278Z] 17:14:16     INFO -  In file included from Unified_cpp_unicharutil_util0.cpp:11:
[task 2024-01-31T17:14:16.279Z] 17:14:16    ERROR -  /builds/worker/checkouts/gecko/intl/unicharutil/util/ICUUtils.cpp:45:19: error: reference to non-static member function must be called; did you mean to call it with no arguments?
[task 2024-01-31T17:14:16.279Z] 17:14:16     INFO -     45 |     if (mContent->OwnerDoc->ShouldResistFingerprinting(RFPTarget::JSLocale)) {
[task 2024-01-31T17:14:16.279Z] 17:14:16     INFO -        |         ~~~~~~~~~~^~~~~~~~
[task 2024-01-31T17:14:16.280Z] 17:14:16     INFO -        |                           ()
[task 2024-01-31T17:14:16.280Z] 17:14:16     INFO -  1 error generated.
[task 2024-01-31T17:14:16.281Z] 17:14:16    ERROR -  gmake[4]: *** [/builds/worker/checkouts/gecko/config/rules.mk:690: Unified_cpp_unicharutil_util0.o] Error 1
[task 2024-01-31T17:14:16.281Z] 17:14:16     INFO -  gmake[4]: Leaving directory '/builds/worker/workspace/obj-build/intl/unicharutil/util'
[task 2024-01-31T17:14:16.281Z] 17:14:16     INFO -  gmake[4]: Target 'target-objects' not remade because of errors.
[task 2024-01-31T17:14:16.282Z] 17:14:16    ERROR -  gmake[3]: *** [/builds/worker/checkouts/gecko/config/recurse.mk:72: intl/unicharutil/util/target-objects] Error 2
[task 2024-01-31T17:14:16.289Z] 17:14:16     INFO -  gmake[4]: Entering directory '/builds/worker/workspace/obj-build/js/xpconnect/src'
[task 2024-01-31T17:14:16.290Z] 17:14:16     INFO -  mkdir -p '.deps/'
[task 2024-01-31T17:14:16.290Z] 17:14:16     INFO -  gmake[4]: Leaving directory '/builds/worker/workspace/obj-build/js/xpconnect/src'
Flags: needinfo?(pierov)

Oops, I've sent a fixed version to phab, sorry for the mistake!

Flags: needinfo?(pierov)
Pushed by tritter@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/21bd8b0b0b61 Use en-US as a fallback when spoof English is enabled in ICUUtils. r=timhuang,tjr
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 124 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: