// 2. If source is undefined or null, let keys be an empty List. if (IsUndefined(*source, isolate) || IsNull(*source, isolate)) { returnReadOnlyRoots(isolate).undefined_value(); }
// 2. If source is undefined or null, let keys be an empty List. if (IsUndefined(*source, isolate) || IsNull(*source, isolate)) { returnReadOnlyRoots(isolate).undefined_value(); }
TF_BUILTIN(SetDataProperties, SetOrCopyDataPropertiesAssembler) { auto target = Parameter<JSReceiver>(Descriptor::kTarget); auto source = Parameter<Object>(Descriptor::kSource); auto context = Parameter<Context>(Descriptor::kContext);
// 遍历所有的属性 for (int i = 0; i < keys->length(); ++i) { // 获取第i个属性的key对象 (属性的key也是一个js对象) Handle<Object> next_key(keys->get(i), isolate); if (excluded_properties != nullptr && HasExcludedProperty(excluded_properties, next_key)) { continue; }
// 4a i. Let desc be ? from.[[GetOwnProperty]](nextKey). // 获取该key的属性描述符 PropertyDescriptor desc; Maybe<bool> found = JSReceiver::GetOwnPropertyDescriptor(isolate, from, next_key, &desc); if (found.IsNothing()) return Nothing<bool>(); // 4a ii. If desc is not undefined and desc.[[Enumerable]] is true, then // 改属性为可枚举属性 if (found.FromJust() && desc.enumerable()) { // 获取该属性的value对象 Handle<Object> prop_value; ASSIGN_RETURN_ON_EXCEPTION_VALUE( isolate, prop_value, Runtime::GetObjectProperty(isolate, from, next_key), Nothing<bool>());
// 把属性写入target中 if (use_set) { // 4c ii 2. Let status be ? Set(to, nextKey, propValue, true). Handle<Object> status; ASSIGN_RETURN_ON_EXCEPTION_VALUE( isolate, status, Runtime::SetObjectProperty(isolate, target, next_key, prop_value, StoreOrigin::kMaybeKeyed, Just(ShouldThrow::kThrowOnError)), Nothing<bool>()); } else { // 4a ii 2. Perform ! CreateDataProperty(target, nextKey, propValue). PropertyKey key(isolate, next_key); CHECK(JSReceiver::CreateDataProperty(isolate, target, key, prop_value, Just(kThrowOnError)) .FromJust()); } } }
// fast path只能处理source为JSObject的情况 if (!IsJSObjectMap(*map)) returnJust(false); // fast path只能处理source为simple properties的情况(非dictionary properties) if (!map->OnlyHasSimpleProperties()) returnJust(false);
// 只能处理source的elements为empty fixed array的情况 Handle<JSObject> from = Handle<JSObject>::cast(source); if (from->elements() != ReadOnlyRoots(isolate).empty_fixed_array()) { returnJust(false); }
diff --git a/src/objects/js-objects.cc b/src/objects/js-objects.cc index c3f5d31..13b787f 100644 --- a/src/objects/js-objects.cc +++ b/src/objects/js-objects.cc @@ -434,9 +434,7 @@ Nothing<bool>()); if (!from->HasFastProperties() && target->HasFastProperties() && - !IsJSGlobalProxy(*target)) { - // JSProxy is always in slow-mode. - DCHECK(!IsJSProxy(*target)); + IsJSObject(*target) && !IsJSGlobalProxy(*target)) { // Convert to slow properties if we're guaranteed to overflow the number of // descriptors. int source_length;
TF_BUILTIN(SetDataProperties, SetOrCopyDataPropertiesAssembler) { auto target = Parameter<JSReceiver>(Descriptor::kTarget); auto source = Parameter<Object>(Descriptor::kSource); auto context = Parameter<Context>(Descriptor::kContext);
This article analyzes the cause of CVE-2024-31317, an Android user-mode universal vulnerability, and shares our exploitation research and methods. Through this vulnerability, we can obtain code-execution for any uid, similar to breaking through the Android sandbox to gain permissions for any app. This vulnerability has effects similar to the Mystique vulnerability discovered by the author years ago (which won the Pwnie Award for Best Privilege Escalation Bug), but each has its own merits.
The Android Application Sandbox is the cornerstone of the Android Security Model, which protects and isolates each application’s process and data from the others. Attackers usually need kernel vulnerabilities to escape the sandbox, which by themselves proved to be quite rare and difficult due to emerging mitigation and attack surfaces tightened.
However, we found a vulnerability in the Android 11 stable that breaks the dam purely from userspace. Combined with other 0days we discovered in major Android vendors forming a chain, a malicious zero permission attacker app can totally bypass the Android Application Sandbox, owning any other applications such as Facebook and WhatsApp, reading application data, injecting code or even trojanize the application ( including unprivileged and privileged ones ) without user awareness. We named the chain "Mystique" after the famous Marvel Comics character due to the similar ability it possesses.
In this talk we will give a detailed walk through on the whole vulnerability chain and bugs included. On the attack side, we will discuss the bugs in detail and share our exploitation method and framework that enables privilege escalation, transparently process injection/hooking/debugging and data extraction for various target applications based on Mystique, which has never been talked about before. On the defense side, we will release a detection SDK/tool for app developers and end users since this new type of attack differs from previous ones, which largely evade traditional analysis.