summaryrefslogtreecommitdiff
path: root/internal/processor/processor_test.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-04-27 08:33:38 +0300
committerPaul Buetow <paul@buetow.org>2026-04-27 08:33:44 +0300
commit257057748a2cf2070fbeb722a94772857b5d014f (patch)
treecd3110920d12d2b22ba4918898aa4437799d1bba /internal/processor/processor_test.go
parent8b37e6e04035f9f8a3d01701dae121cdc67cbf43 (diff)
processor: reject markdown image refs with path separators or parent traversal
findLocalImages used filepath.Base(ref) after stat succeeded, which caused subdirectory or parent-directory references to pass the scan but then fail during copy because the basename was looked up in the wrong directory. Fix: add isSimpleImageRef helper that accepts only flat filenames (no path separators, no .. traversal). findLocalImages now returns the ref unchanged, matching what copyLocalImages and claimedByMarkdown expect. Added tests for isSimpleImageRef and negative findLocalImages cases for subdirectory and parent-directory references.
Diffstat (limited to 'internal/processor/processor_test.go')
0 files changed, 0 insertions, 0 deletions