Credential Access
- Category
- Privilege Escalation
- Confidence
- 70% confidence
- Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
- Content
js t d=path.join(w,'.mochilab',slug);fs.mkdirSync(d,{recursive:true});fs.writeFileSync(path.join(d,'write.lock'),'active');assert.throws(()=>call(w,{action:'list'}),/busy/);assert.equal(fs.readFileSync(path.join(d,'write.lock'),'utf8'),'active');}); test('a failed operation preserves the previous state',()=>{const w=fresh();transact(w,slug,{requestId:'good'},(i,s)=>{s.records.push('saved');return {changed:true,result:{done:true}};});const file=path.join(w,'.mochilab',slug,'state.json'),before=fs.readFileSync(file,'utf8');assert.throws(()=>transact(w,slug,{requestId:'bad'},(i,s)=>{s.records.push('unsaved');throw new Error('failed');}));assert.equal(fs.readFileSync(file,'utf8'),before);}); test('linked paths are rejected when supported by the host',t=>{const w=fresh(),outside=fresh();try{fs.symlinkSync(outside,path.join(w,'linked'),process.platform==='win32'?'junction':'dir');}catch{t.skip('Host does not allow symlink creation');return;}assert.throws(()=>safePath(w,'linked/secret.txt'));});
