Arc के क्लाउड फीचर का परिचय
- Arc का उपयोग करने के लिए अकाउंट आवश्यक है
- authentication के लिए Firebase का उपयोग होता है
- 'Easels' नाम का व्हाइटबोर्ड जैसा एक फीचर है
- share बटन पर क्लिक करने पर भी mitmproxy में request दिखाई नहीं देती
Objective-C आधारित Firebase ऐप हैकिंग
- Firestore का उपयोग करके backend लिखा गया, बिना अलग backend लिखे सिर्फ database security rules बनाई गईं
- Firestore Swift SDK में system proxy settings को follow नहीं करता
- संबंधित calls को dump करने के लिए Frida script लिखी गई
var documentWithPath = ObjC.classes.FIRCollectionReference["- documentWithPath:"];
var queryWhereFieldIsEqualTo = ObjC.classes.FIRQuery["- queryWhereField:isEqualTo:"];
var collectionWithPath = ObjC.classes.FIRFirestore["- collectionWithPath:"];
function getFullPath(obj) {
if (obj.path && typeof obj.path === "function") {
return obj.path().toString();
}
return obj.toString();
}
var queryStack = [];
function logQuery(query) {
var queryString = `firebase.${query.type}("${query.path}")`;
query.whereClauses.forEach((clause) => {
queryString += `.where("${clause.fieldName}", "==", "${clause.value}")`;
});
console.log(queryString);
}
Interceptor.attach(documentWithPath.implementation, {
onEnter: function (args) {
var parent = ObjC.Object(args[0]);
var docPath = ObjC.Object(args[2]).toString();
var fullPath = getFullPath(parent) + "/" + docPath;
var query = { type: "doc", path: fullPath, whereClauses: [] };
queryStack.push(query);
logQuery(query);
},
});
Interceptor.attach(collectionWithPath.implementation, {
onEnter: function (args) {
var collectionPath = ObjC.Object(args[2]).toString();
var query = { type: "collection", path: collectionPath, whereClauses: [] };
queryStack.push(query);
},
});
Interceptor.attach(queryWhereFieldIsEqualTo.implementation, {
onEnter: function (args) {
var fieldName = ObjC.Object(args[2]).toString();
var value = ObjC.Object(args[3]).toString();
if (queryStack.length > 0) {
var currentQuery = queryStack[queryStack.length - 1];
currentQuery.whereClauses.push({ fieldName: fieldName, value: value });
}
},
onLeave: function (retval) {},
});
var executionMethods = [
"- getDocuments",
"- addSnapshotListener:",
"- getDocument",
"- addDocumentSnapshotListener:",
"- getDocumentsWithCompletion:",
"- getDocumentWithCompletion:",
];
executionMethods.forEach(function (methodName) {
if (ObjC.classes.FIRQuery[methodName]) {
Interceptor.attach(ObjC.classes.FIRQuery[methodName].implementation, {
onEnter: function (args) {
if (queryStack.length > 0) {
var query = queryStack.pop();
logQuery(query);
}
},
});
}
});
function formatFirestoreData(data) {
if (data.isKindOfClass_(ObjC.classes.NSDictionary)) {
let result = {};
data.enumerateKeysAndObjectsUsingBlock_(
ObjC.implement(function (key, value) {
result[key.toString()] = value.toString();
})
);
return JSON.stringify(result);
}
return data.toString();
}
var documentMethods = [
{ name: "- updateData:completion:", type: "update" },
{ name: "- updateData:", type: "update" },
{ name: "- setData:completion:", type: "set" },
{ name: "- setData:", type: "set" },
];
documentMethods.forEach(function (method) {
if (ObjC.classes.FIRDocumentReference[method.name]) {
Interceptor.attach(
ObjC.classes.FIRDocumentReference[method.name].implementation,
{
onEnter: function (args) {
var docRef = ObjC.Object(args[0]);
var data = ObjC.Object(args[2]);
var fullPath = getFullPath(docRef);
var formattedData = formatFirestoreData(data);
console.log(
`firebase.doc("${fullPath}").${method.type}(${formattedData})`
);
},
}
);
} else {
console.log("Warning: " + method.name + " not found");
}
});
- Arc Firestore में user preferences, user objects, recommendations और boosts को store करता है
Arc Boost क्या है
- Arc Boost उपयोगकर्ताओं के लिए वेबसाइट को customize करने का एक तरीका है
- element blocking, font बदलना, color बदलना, custom CSS और JS का उपयोग संभव है
- boost बनाकर उसे किसी दूसरे user ID से update किया जा सकता है
दूसरे उपयोगकर्ता की ID प्राप्त करना
- user recommendations: recommendation table से user ID प्राप्त की जा सकती है
- public boosts: boost snapshot में creator की user ID शामिल होती है
- user easels: easel share करके user ID प्राप्त की जा सकती है
अंतिम attack chain
- पीड़ित की user ID प्राप्त की जाती है
- malicious boost बनाया जाता है और उसे अपने अकाउंट में store किया जाता है
- boost के
creatorID field को target की ID से update किया जाता है
- पीड़ित target वेबसाइट पर जाता है तो वह संक्रमित हो जाता है
privileged pages पर RCE
- boost दूसरे protocols पर भी execute होता है
chrome://settings page में privilege escalation संभव है
privacy समस्या
- जिन sites पर जाया जाता है, उनका data server पर भेजा जाता है
- यह Arc की privacy policy के विरुद्ध है
GN⁺ का सार
- यह Arc के cloud features और security vulnerabilities का विश्लेषण करने वाला लेख है
- इसमें Firestore का उपयोग करने वाले backend security issues को कवर किया गया है
- Arc Boost के जरिए user customization और security weaknesses को समझाया गया है
- दूसरे उपयोगकर्ताओं की ID लेकर malicious boost चलाने का तरीका दिखाया गया है
- privacy issues और privilege escalation की संभावना को लेकर चिंता जताई गई है
1 टिप्पणियां
Hacker News की राय