astro-minimax v0.9.2 focuses on security hardening and architectural improvements. Following a parallel deep audit of all four packages, we fixed XSS/path traversal vulnerabilities, completed two rounds of component splitting, and consolidated configuration constants to a single source of truth.
Security Fixes
URL Protocol Validation (Critical)
Model-generated Markdown links in AI chat and URLs in notification templates now pass through a protocol allowlist (only http/https/mailto), preventing javascript: XSS attack vectors.
Mermaid Security Hardening
MermaidBlock securityLevel changed from 'loose' to 'strict', preventing malicious Mermaid syntax from executing scripts via SVG injection.
PostsContainer HTML Escaping
Client-side rendered post cards now escape title, description, category, and tag values, eliminating stored XSS risk.
CLI Path Traversal Protection
The extensions validate command now validates that file paths don’t escape the extensions directory, preventing ../ path traversal.
Notification Log Redaction
Webhook logs no longer output full URLs (which may contain ?token= credentials), showing only origin + pathname.
Architecture Improvements
Component Splitting — AI Package
| File | Lines | Extracted Modules |
|---|---|---|
ChatPanel.tsx | 1020→580 | RichText.tsx, MessageBubble.tsx, ChatInput.tsx, ReasoningBlock.tsx |
CodeBlock.tsx | 785→256 | MermaidBlock.tsx, MarkmapBlock.tsx, VizShared.tsx |
Module Splitting — CLI Package
ai.ts (1167 lines) split into 6 focused modules: index (122 lines), types, run-tool, profile, facts, extensions.
Single-Source Configuration
Eliminated 8 duplicated configuration constants, all consolidated into constants.ts: timeouts, search parameters, cache TTL, and CLI version.
Reliability Improvements
- Notification Timeouts: Telegram/Email/Webhook providers now use
AbortSignal.timeout(10s) - Stream Success Semantics:
stream-helperscorrectly returnssuccess: falseon errors - Configurable CORS: New
setCorsOrigin()API andenv.CORS_ORIGINsupport - AIChatContainer Side Effect Fix:
window.__aiChatTogglemoved intouseEffect - CLI Exit Code Fix:
vectorize.tsproperly callsprocess.exit(1)on failure - Post Frontmatter Alignment:
post newgeneratespubDatetime/modDatetime/category
Architecture Progress
| Phase | Completion |
|---|---|
| Phase 1 (Initial Audit) | 19/21 (90%) |
| Phase 2 (Deep Audit) | 18/25 (72%) |
| Total | 37/46 (80%) |
评论区
文明评论,共建和谐社区