T09 · Insecure Skill Coding Practices
- Location
scripts/generate_card.py:48- Finding
Persistent HTML and JavaScript Injection in Generated Journal Cards
- Content
View full analysis
List[Dict]: lines = raw_input.strip().split('\n') for line in lines: line = line.strip() if not line: continue time_str, has_time, content = self.extract_time(line) polished_content = self.polish_language(content) symbol, note_type, _ = self.classify_note( polished_content, has_time ) is_work_study = self.is_work_study(polished_content) note = { 'symbol': symbol, 'type': note_type, 'content': polished_content, 'time': time_str, 'has_time': has_time, 'is_work_study': is_work_study, 'raw': line } self.processed_notes.append(note) ``` The standard card generator directly interpolates that content into HTML: ```python # scripts/generate_card.py:48-75 def generate_notes_html(self, notes: List[Dict]) -> str: """Generate note content as HTML.""" html_lines = [] for note in notes: symbol_class = note['type'] time_html = "" if note.get('time'): time_html = f'{note["time"]}' note_html = f"""{note['symbol']}""" html_lines.append(note_html) ...[truncated 5721 chars]{time_html}{note['content']}- Remediation
View remediation
