T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/service.py:116- Finding
Untrusted Inline Image Directives Can Exfiltrate Arbitrary Local Files
- Content
View full analysis
str: path = match.group(1).strip() align = (match.group(2) or "center").strip() name = path.rsplit("/", 1)[-1] try: result = upload_func(project_id, issue_id, path) except Exception: return f'[image upload failed: {path}]
' embed_url = result.get("embed_url") or result.get("asset_url") or "" if embed_url: if embed_url.startswith("/"): embed_url = base_url.rstrip("/") + embed_url else: return f'[image URL unavailable: {path}]
' return _build_image_html(embed_url, align, name) ``` ```python if _IMAGE_DIRECTIVE_RE.search(description): description_html = render_markdown_with_inline_images( description, self.client.upload_attachment, str(project_obj["id"]), str(issue["id"]), self.client.base_url, ) ``` ```python if _IMAGE_DIRECTIVE_RE.search(description): base_html = render_markdown_with_inline_images( description, self.client.upload_attachment, str(project_obj["id"]), issue_id, self.client.base_url, ) ``` ```python filename = os.path.basename(file_path) file_size = os.path.getsize(file_path) import mimetypes mime_type, _ = mimetypes.guess_type(file_path) file_type = mime_type or "application/octet-stream" # Step 1: Get presigned URL presigned_data = self._get_presigned_url_for_attachment( project_id, issue_id, filename, file_size, file_type ) # Step 2: Upload f ...[truncated 2840 chars]- Remediation
View remediation
