T09 · Insecure Skill Coding Practices
- Location
src/backup.js:77- Finding
Documented dry-run mode performs a real external upload and blockchain transaction
- Content
View full analysis
path.resolve(__dirname, '..', f)); const cwd = path.resolve(__dirname, '../..'); await tar.c( { gzip: true, file: archivePath, cwd, }, [...filesToBackup, 'memory'] ); tempFiles.push(archivePath); // Generate SHA-256 hash of archive before encryption const archiveBuffer = fs.readFileSync(archivePath); const checksum = crypto.createHash('sha256').update(archiveBuffer).digest('hex'); const checksumPath = path.resolve(__dirname, 'checksum.txt'); fs.writeFileSync(checksumPath, checksum); tempFiles.push(checksumPath); console.log('Archive checksum:', checksum); // Create payload with archive + checksum const payloadPath = path.resolve(__dirname, 'payload.tar'); await tar.c( { file: payloadPath, cwd: __dirname, }, ['backup.tar.gz', 'checksum.txt'] ); tempFiles.push(payloadPath); // Load wallet secret key const walletPath = path.resolve(__dirname, '../..', 'x1_vault_cli', 'wallet.json'); if ( ...[truncated 4325 chars]- Remediation
View remediation
