Vulnerable Code SAEs
Collection
8 items • Updated
vuln_id stringlengths 13 19 | secure_code stringlengths 69 7.85k | vulnerable_code stringlengths 27 7.57k | cwe stringclasses 25 values | file_extension stringclasses 14 values | secure listlengths 16.4k 16.4k | vulnerable listlengths 16.4k 16.4k | layer int64 0 0 | sae_config dict |
|---|---|---|---|---|---|---|---|---|
GHSA-23cm-x6j7-6hq3 | interface IPayload extends Partial<IMessage> { } /* eslint-enable camelcase */ /** * @private * @constructor interface IPayload extends Partial<IMessage> { * * @property {object} sharedWithDevices * devices with which we have shared the session key * userId -> {deviceId -> msgindex} */ class OutboundSessionInfo { public useCount = 0; public creationTime: number; public sharedWithDevices: Record<string, Record<string, number>> = {}; public blockedDevicesNotified: Record<string, Record<string, boolean>> = {}; constructor(public readonly sessionId: string, public readonly sharedHistory = false) { class OutboundSessionInfo { return false; } public markSharedWithDevice(userId: string, deviceId: string, chainIndex: number): void { if (!this.sharedWithDevices[userId]) { this.sharedWithDevices[userId] = {}; } this.sharedWithDevices[userId][deviceId] = chainIndex; } public markNotifiedBlockedDevice(userId: string, deviceId: string): void { class MegolmEncryption extends EncryptionAlgorithm { payload: IPayload, ): Promise<void> { const contentMap = {}; const promises = []; for (let i = 0; i < userDeviceMap.length; i++) { class MegolmEncryption extends EncryptionAlgorithm { const userId = val.userId; const deviceInfo = val.deviceInfo; const deviceId = deviceInfo.deviceId; if (!contentMap[userId]) { contentMap[userId] = {}; class MegolmEncryption extends EncryptionAlgorithm { for (const userId of Object.keys(contentMap)) { for (const deviceId of Object.keys(contentMap[userId])) { session.markSharedWithDevice( userId, deviceId, chainIndex, ); } } class MegolmEncryption extends EncryptionAlgorithm { logger.debug(`megolm session ${sessionId} never shared with user ${userId}`); return; } const sentChainIndex = obSessionInfo.sharedWithDevices[userId][device.deviceId]; if (sentChainIndex === undefined) { logger.debug( "megolm session ID " + sessionId + " never shared with device " + userId + ":" + device.deviceId, ); return; } // get the key from the inbound session: the outbound one will already // have been ratcheted to the next chain index. const key = await this.olmDevice.getInboundGroupSessionKey( this.roomId, senderKey, sessionId, sentChainIndex, ); if (!key) { class MegolmEncryption extends EncryptionAlgorithm { const deviceId = deviceInfo.deviceId; session.markSharedWithDevice( userId, deviceId, key.chain_index, ); } | interface IPayload extends Partial<IMessage> { } /* eslint-enable camelcase */ interface SharedWithData { // The identity key of the device we shared with deviceKey: string; // The message index of the ratchet we shared with that device messageIndex: number; } /** * @private * @constructor interface IPayload extends Partial<IMessage> { * * @property {object} sharedWithDevices * devices with which we have shared the session key * userId -> {deviceId -> SharedWithData} */ class OutboundSessionInfo { public useCount = 0; public creationTime: number; public sharedWithDevices: Record<string, Record<string, SharedWithData>> = {}; public blockedDevicesNotified: Record<string, Record<string, boolean>> = {}; constructor(public readonly sessionId: string, public readonly sharedHistory = false) { class OutboundSessionInfo { return false; } public markSharedWithDevice(userId: string, deviceId: string, deviceKey: string, chainIndex: number): void { if (!this.sharedWithDevices[userId]) { this.sharedWithDevices[userId] = {}; } this.sharedWithDevices[userId][deviceId] = { deviceKey, messageIndex: chainIndex }; } public markNotifiedBlockedDevice(userId: string, deviceId: string): void { class MegolmEncryption extends EncryptionAlgorithm { payload: IPayload, ): Promise<void> { const contentMap = {}; const deviceInfoByDeviceId = new Map<string, DeviceInfo>(); const promises = []; for (let i = 0; i < userDeviceMap.length; i++) { class MegolmEncryption extends EncryptionAlgorithm { const userId = val.userId; const deviceInfo = val.deviceInfo; const deviceId = deviceInfo.deviceId; deviceInfoByDeviceId.set(deviceId, deviceInfo); if (!contentMap[userId]) { contentMap[userId] = {}; class MegolmEncryption extends EncryptionAlgorithm { for (const userId of Object.keys(contentMap)) { for (const deviceId of Object.keys(contentMap[userId])) { session.markSharedWithDevice( userId, deviceId, deviceInfoByDeviceId.get(deviceId).getIdentityKey(), chainIndex, ); } } class MegolmEncryption extends EncryptionAlgorithm { logger.debug(`megolm session ${sessionId} never shared with user ${userId}`); return; } const sessionSharedData = obSessionInfo.sharedWithDevices[userId][device.deviceId]; if (sessionSharedData === undefined) { logger.debug( "megolm session ID " + sessionId + " never shared with device " + userId + ":" + device.deviceId, ); return; } if (sessionSharedData.deviceKey !== device.getIdentityKey()) { logger.warn( `Session has been shared with device ${device.deviceId} but with identity ` + `key ${sessionSharedData.deviceKey}. Key is now ${device.getIdentityKey()}!`, ); return; } // get the key from the inbound session: the outbound one will already // have been ratcheted to the next chain index. const key = await this.olmDevice.getInboundGroupSessionKey( this.roomId, senderKey, sessionId, sessionSharedData.messageIndex, ); if (!key) { class MegolmEncryption extends EncryptionAlgorithm { const deviceId = deviceInfo.deviceId; session.markSharedWithDevice( userId, deviceId, deviceInfo.getIdentityKey(), key.chain_index, ); } | CWE-200 | ts | [
0,
0,
0,
0,
0,
1.7772232294082642,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
1.794287919998169,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | 0 | {
"model": "Qwen/Qwen2.5-7B-Instruct",
"release": "rufimelo/vulnerable_code_qwen_coder_standard_16384",
"cached_component": "hook_resid_post.hook_sae_acts_post",
"layers_available": [
0,
3,
7,
11,
15,
19,
23,
27
],
"local_path_template": null
} |
GHSA-23fp-fmrv-f5px | " const formatError = error => [ { messages: [{ id: error.id, message: error.message, field: error(...TRUNCATED) | " const formatError = error => [ { messages: [{ id: error.id, message: error.message, field: error(...TRUNCATED) | CWE-400 | js | [0.0,0.0,0.0,0.0,0.0,1.9238594770431519,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,(...TRUNCATED) | [0.0,0.0,0.0,0.0,0.0,1.9262491464614868,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,(...TRUNCATED) | 0 | {"model":"Qwen/Qwen2.5-7B-Instruct","release":"rufimelo/vulnerable_code_qwen_coder_standard_16384","(...TRUNCATED) |
GHSA-23hm-7w47-xw72 | " class DequantizeOp : public OpKernel { const Tensor& input_min_tensor = ctx->input(1); con(...TRUNCATED) | " class DequantizeOp : public OpKernel { const Tensor& input_min_tensor = ctx->input(1); con(...TRUNCATED) | CWE-125 | cc | [0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0(...TRUNCATED) | [0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0(...TRUNCATED) | 0 | {"model":"Qwen/Qwen2.5-7B-Instruct","release":"rufimelo/vulnerable_code_qwen_coder_standard_16384","(...TRUNCATED) |
GHSA-247x-2f9f-5wp7 | " limitations under the License. #include \"tensorflow/core/framework/attr_value.pb.h\" #include \"t(...TRUNCATED) | " limitations under the License. #include \"tensorflow/core/framework/attr_value.pb.h\" #include \"t(...TRUNCATED) | CWE-400 | cc | [0.0,0.0,0.0,0.0,0.0,1.9777387380599976,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,(...TRUNCATED) | [0.0,0.0,0.0,0.0,0.0,1.9374788999557495,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,(...TRUNCATED) | 0 | {"model":"Qwen/Qwen2.5-7B-Instruct","release":"rufimelo/vulnerable_code_qwen_coder_standard_16384","(...TRUNCATED) |
GHSA-24m3-w8g9-jwpq | " function ($val) { throw new Error\\NotFound('The URL wasn\\'t found in the module.'); (...TRUNCATED) | " function ($val) { throw new Error\\NotFound('The URL wasn\\'t found in the module.'); (...TRUNCATED) | CWE-200 | php | [0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.043622080236673355,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.(...TRUNCATED) | [0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.04617821052670479,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0(...TRUNCATED) | 0 | {"model":"Qwen/Qwen2.5-7B-Instruct","release":"rufimelo/vulnerable_code_qwen_coder_standard_16384","(...TRUNCATED) |
GHSA-24x4-6qmh-88qg | " class DecodeImageV2Op : public OpKernel { if (width != static_cast<int64_t>(decode.width) || w(...TRUNCATED) | " class DecodeImageV2Op : public OpKernel { if (width != static_cast<int64_t>(decode.width) || w(...TRUNCATED) | CWE-416 | cc | [0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0(...TRUNCATED) | [0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0(...TRUNCATED) | 0 | {"model":"Qwen/Qwen2.5-7B-Instruct","release":"rufimelo/vulnerable_code_qwen_coder_standard_16384","(...TRUNCATED) |
GHSA-24x6-8c7m-hv3f | " template <KernelType kernel_type, typename OpType> TfLiteStatus Eval(TfLiteContext* context, TfLit(...TRUNCATED) | " template <KernelType kernel_type, typename OpType> TfLiteStatus Eval(TfLiteContext* context, TfLit(...TRUNCATED) | CWE-125 | cc | [0.0,0.0,0.0,0.0,0.0,2.0681869983673096,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,(...TRUNCATED) | [0.0,0.0,0.0,0.0,0.0,2.0841310024261475,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,(...TRUNCATED) | 0 | {"model":"Qwen/Qwen2.5-7B-Instruct","release":"rufimelo/vulnerable_code_qwen_coder_standard_16384","(...TRUNCATED) |
GHSA-2598-2f59-rmhq | " var QueryGenerator = { path[path.length - 1] = $tmp[0]; } $baseKe(...TRUNCATED) | " var QueryGenerator = { path[path.length - 1] = $tmp[0]; } var pat(...TRUNCATED) | CWE-89 | js | [0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.007701212540268898,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.(...TRUNCATED) | [0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.006253882311284542,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.(...TRUNCATED) | 0 | {"model":"Qwen/Qwen2.5-7B-Instruct","release":"rufimelo/vulnerable_code_qwen_coder_standard_16384","(...TRUNCATED) |
GHSA-278g-rq84-9hmg | " class MapStageOp : public OpKernel { OP_REQUIRES_OK(ctx, ctx->input(\"key\", &key_tensor)); (...TRUNCATED) | " class MapStageOp : public OpKernel { OP_REQUIRES_OK(ctx, ctx->input(\"key\", &key_tensor)); (...TRUNCATED) | CWE-20 | cc | [0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.043434690684080124,0.0,0.0,0.0,0.0,0.027221145108(...TRUNCATED) | [0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.04745003208518028,0.0,0.0,0.0,0.0,0.0249166265130(...TRUNCATED) | 0 | {"model":"Qwen/Qwen2.5-7B-Instruct","release":"rufimelo/vulnerable_code_qwen_coder_standard_16384","(...TRUNCATED) |
GHSA-27qf-jwm8-g7f3 | " limitations under the License. // // Input: // Tensor[0]: Hash functions. Dim.size == 2, DataTyp(...TRUNCATED) | " limitations under the License. // // Input: // Tensor[0]: Hash functions. Dim.size == 2, DataTyp(...TRUNCATED) | CWE-369 | cc | [0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.07250972837209702,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0(...TRUNCATED) | [0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.07022339105606079,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0(...TRUNCATED) | 0 | {"model":"Qwen/Qwen2.5-7B-Instruct","release":"rufimelo/vulnerable_code_qwen_coder_standard_16384","(...TRUNCATED) |