mirror of
https://github.com/davidkaya/aryx.git
synced 2026-08-04 02:48:44 +02:00
fix(security): harden YAML parsing, path traversal, and markdown links
- workflowSerialization: restrict YAML parser to core schema with no custom tags - gitService: validate file paths stay within project directory before I/O - chatMarkdown: allowlist URL protocols (https, http, mailto, anchors) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -100,10 +100,15 @@ export const chatMarkdownComponents: Components = {
|
||||
},
|
||||
|
||||
a({ href, children }) {
|
||||
const url = String(href ?? '');
|
||||
const isSafe = /^https?:|^mailto:|^#/i.test(url);
|
||||
if (!isSafe) {
|
||||
return <span className="text-indigo-400">{children as ReactNode}</span>;
|
||||
}
|
||||
return (
|
||||
<a
|
||||
className="text-indigo-400 underline underline-offset-2 transition hover:text-indigo-300"
|
||||
href={String(href)}
|
||||
href={url}
|
||||
rel="noopener noreferrer"
|
||||
target="_blank"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user