T09 · Insecure Skill Coding Practices
- Location
src/skill.ts:133- Finding
Caller-Controlled Simulator State Enables Prompt Injection and Safety Bypass
- Content
View full analysis
`${t.speaker === "user" ? "User" : persona.name}: ${t.message}`) .join("\n"); return `You are playing a character in a flirting conversation simulator. The user is practicing their texting game. Your character: Name: ${persona.name} Personality: ${persona.archetype} Description: ${persona.description} Warmth level: ${persona.warmthLevel}/3 (1 = reserved/guarded, 2 = moderate, 3 = warm/open) Conversation so far: ${history || "(No messages yet — this is the opening)"} User just sent: "${userMessage}" ``` ### Technical Analysis The routing layer treats `payload.state` as a valid `SimState` through a TypeScript assertion. Type assertions provide no runtime validation, so a caller can supply arbitrary values for: - `state.persona.name` - `state.persona.archetype` - `state.persona.description` - Historical turn messages and speaker values - `state.currentScore` - `state.m ...[truncated 2194 chars]- Remediation
View remediation
