T09 · Insecure Skill Coding Practices
- Location
src/diagnosis.ts:45- Finding
Unredacted DLQ Content Disclosed to Bedrock and Telegram
- Content
View full analysis
{ try { const resp = await sqs.send( new ReceiveMessageCommand({ QueueUrl: dlqUrl, MaxNumberOfMessages: 1, VisibilityTimeout: 10, WaitTimeSeconds: 1, }), ); const body = resp.Messages?.[0]?.Body; return body ? body.slice(0, 800) : null; } catch { return null; } } ``` `src/diagnosis.ts:45-54`: ```typescript const lines: string[] = [ `Detected issues: ${issues.join(" | ")}`, `AWS Region: ${region}`, `DLQ URL: ${dlqUrl}`, `Queue URL: ${queueUrl}`, ]; if (dlqSample) { lines.push(`DLQ message sample (1 msg): ${dlqSample}`); } ``` `src/diagnosis.ts:71-85`: ```typescript const body = JSON.stringify({ anthropic_version: "bedrock-2023-05-31", max_tokens: 400, system: SYSTEM_PROMPT, messages: [{ role: "user", content: lines.join("\n") }], }); try { const resp = await bedrockClient.send( new InvokeModelCommand({ modelId, contentType: "application/json", accept: "application/json", body: Buffer.from(body), }), ); ``` `src/diagnosis.ts:95-99`: ```typescript return { contexto: issues.join(". "), solucoes: dlqSample ? [`DLQ sample read: ${dlqSample.slice(0, 120)}…`] : [], ctas: [ ``` `src/reporter.ts:75-86`: ```typescript if (incident) { msg += `\n🔴 *Incident Detected*\n`; msg += `\n*Context*\n${esc(incident.contexto)}\n` ...[truncated 2988 chars]- Remediation
View remediation
