T09 · Insecure Skill Coding Practices
- Location
src/index.js:49- Finding
Terminal Escape-Sequence Injection Through Untrusted Hacker News Content
- Content
View full analysis
]*>/g, '')}`); } ``` ### Technical Analysis The application retrieves public, user-generated Hacker News data and writes fields such as `story.title`, `story.by`, `story.text`, `user.id`, and `user.about` directly to the terminal. The regular expression applied to `story.text` removes strings resembling HTML tags, but it does not remove terminal control characters or ANSI escape sequences. HTML stripping and terminal-output sanitization address different encoding contexts. If attacker-controlled content contains supported control sequences, a compatible terminal may interpret those bytes instead of displaying them literally. Relevant sequence classes include: - ANSI/CSI sequences that change colors, cursor ...[truncated 1898 chars]- Remediation
View remediation
]*>/g, ''), { allowNewlines: true } ); ``` The sanitizer should be validated against the terminal environments sup ...[truncated 90 chars]
