Security context

What an agent needs to avoid regressing past fixes and find the next vuln in this repo.

golang-migrate/migrate
master @ 2bd822b
2
Fixes
1
CVEs
MEDIUM
Peak severity
Highlights
Denial of Service: 1 prior fix. Scrutinize any change in this area.
CLI: most-fixed (1 issue). Treat as high-risk during review.
0 high-severity fixes in this history; regressions here are high-impact.
Recurring patterns

The bug types that recur here, drawn from past fixes, not open vulnerabilities.

Path Traversal: Unsafe file creation and directory traversal in the CLI allowed arbitrary file creation. Attackers who can manipulate migration name inputs could potentially write migration files outside the intended migrations directory, risking local configuration or code execution overwrite. Developers must consistently enforce path canonicalization via filepath.Clean or filepath.Join followed by a strict prefix check before invoking os.OpenFile.
Denial of Service: Direct type assertions to a specific driver error type (e.g., *pq.Error) without first checking the underlying dynamic type or interface support will cause a panic, crashing the migration execution runner. Future driver integrations or database error wrappers must leverage safe type switches or errors.As to avoid panic-induced DoS.