34500 - [BC - Critical] Prototype pollution vulnerability in get_tx_tim...
Description
Brief/Intro
Vulnerability Details
generateTimestampReceipt(
txId: string,
cycleMarker: string,
cycleCounter: CycleRecord['counter']
): TimestampReceipt {
const tsReceipt: TimestampReceipt = {
txId,
cycleMarker,
cycleCounter,
// shardusGetTime() was replaced with shardusGetTime() so we can have a more reliable timestamp consensus
timestamp: shardusGetTime(),
}
const signedTsReceipt = this.crypto.sign(tsReceipt)
/* prettier-ignore */ this.mainLogger.debug(`Timestamp receipt generated for txId ${txId}: ${utils.stringifyReduce(signedTsReceipt)}`)
// caching ts receipt for later nodes
if (!this.txTimestampCache[signedTsReceipt.cycleCounter]) {
this.txTimestampCache[signedTsReceipt.cycleCounter] = {}
}
// cache to txId map
this.txTimestampCache[signedTsReceipt.cycleCounter][txId] = signedTsReceipt
if (Context.config.p2p.timestampCacheFix) {
// eslint-disable-next-line security/detect-object-injection
this.txTimestampCacheByTxId[txId] = signedTsReceipt
this.seenTimestampRequests[txId] = true
}
/* prettier-ignore */ this.mainLogger.debug(`Timestamp receipt cached for txId ${txId} in cycle ${signedTsReceipt.cycleCounter}: ${utils.stringifyReduce(signedTsReceipt)}`)
return signedTsReceipt
}Impact Details
References
Proof of Concept
Previous34489 - [BC - Insight] ActivetsValidateRecordTypes do not check all th...NextThunderNFT | IOP
Last updated
Was this helpful?