Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3347423
D13270.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D13270.diff
View Options
diff --git a/lib/utils/sanitization.js b/lib/utils/sanitization.js
--- a/lib/utils/sanitization.js
+++ b/lib/utils/sanitization.js
@@ -72,10 +72,18 @@
'curve25519',
'picklingKey',
'pickledAccount',
+ 'commServicesAccessToken',
+ 'blobHash',
+ 'blobHolder',
+ 'holder',
+ 'thumbnailHolder',
+ 'encryptionKey',
+ 'thumbnailEncryptionKey',
]);
// eg {"memberIDs":["123", "456"]} => {"memberIDs":["redacted", "redacted"]}
const keysWithArraysToBeRedacted = new Set([
+ 'devices',
'memberIDs',
'messageIDs',
'already_friends',
@@ -109,6 +117,10 @@
'thumbnailURI',
]);
+// eg {"uri":"comm-blob-service://1a2b3c4d5e6f"}
+// => {"uri":"comm-blob-service://placeholder"}
+const keysWithBlobURIsToBeReplaced = new Set(['blobURI, thumbnailBlobURI']);
+
// (special case that redacts triply-linked [] to handle `daysToEntries` )
// eg "daysToEntries":{"2020-12-29":["123"]}
// => "daysToEntries":{"2020-12-29":["redacted"]}
@@ -132,6 +144,10 @@
return 'https://comm.app/images/placeholder.png';
}
+function placeholderBlobURI(): string {
+ return 'comm-blob-service://placeholder';
+}
+
function scrambleText(str: string): string {
const arr = [];
for (const char of new String(str)) {
@@ -233,6 +249,8 @@
obj[k] = scrambleText(obj[k]);
} else if (keysWithImageURIsToBeReplaced.has(k)) {
obj[k] = placeholderImageURI();
+ } else if (keysWithBlobURIsToBeReplaced.has(k)) {
+ obj[k] = placeholderBlobURI();
} else if (keysWithArraysToBeRedacted.has(k)) {
obj[k] = obj[k].map(redactionHelpers.redactString);
} else if (typeof obj[k] === 'object') {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 23, 12:12 PM (19 h, 8 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2570537
Default Alt Text
D13270.diff (1 KB)
Attached To
Mode
D13270: [lib] Add more keys to redacted values
Attached
Detach File
Event Timeline
Log In to Comment