SOGo groupware can leak TOTP credential in calendar events under certain conditions:
Public
/Confidential
/Private
configured to View the Date & Time
for attacker@ or all authenticated users
.
View the Date & Time
.
View the Date & Time
visibility will have a long hex UID. The attacker can then hex decode the UID & use bytes [32;44)
as victim@’s TOTP secret.
- (NSString *) totpKey
{
#if defined(MFA_CONFIG)
NSString *key, *result;
const char *s;
char *secret;
size_t s_len, secret_len;
key = [[[self userSettings] userSalt] substringToIndex: 12];
View date & time
visibility (introduced in 875a4aca3218340fd4d3141950c82c2ff45b343d):
uid = [[component uid] asCryptedPassUsingScheme: @"ssha256"
withSalt: [[settings userSalt] dataUsingEncoding: NSASCIIStringEncoding]
andEncoding: encHex
keyPath: nil];
ssha256
scheme appends the salt to the hash:
- (NSData *) asSSHA256UsingSalt: (NSData *) theSalt
{
NSMutableData *sshaData;
// generate salt, if not available
if ([theSalt length] == 0)
theSalt = [NSData generateSaltForLength: 8];
// put the pass and salt together as one data array
sshaData = [NSMutableData dataWithData: self];
[sshaData appendData: theSalt];
// generate SHA1 from pass + salt
sshaData = [NSMutableData dataWithData: [sshaData asSHA256]];
// append salt again
[sshaData appendData: theSalt];
return sshaData;
}
<vevent>[...]
<summary><text>(Confidential event)</text></summary>
<uid><text>fe5af31ed1a48c59194ac04a9d1a855fd50816a5be4b8ed3[...]</text></uid>