fix: import inline relative Markdown images #294
No reviewers
Labels
No labels
activitypub
admin
api
architecture
articles
auth
bug
cleanup
cli
comments
compatibility
config
contacts
content
database
deployment
design
dev-env
diagnostics
docs
documentation
email
enhancement
feature
federation
feed
health
homepage
implementation
integration
logging
mastodon
media
navigation
npm-packages
openapi
opengraph
packages
passkeys
preview
priority:high
priority:low
priority:medium
production
proof
proxy
public-routes
public-ui
release
safety
slug-api
slug-auth
slug-core
slug-federation
slug-media
slug-template
social
sources
status:active
status:canceled
status:done
status:inprogress
status:waiting
syndication
tailwind
template
test
web
webauthn
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
erik/slugkit!294
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/task-6332a4b7-inline-image-import"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Verification
All requests/uploads are mocked. No workflow changes or testing infrastructure: NEVER integration tests in CI or release workflows.
Task: #task-6332a4b7
Safety review blocker fixed; awaiting updated CI, independent re-review and explicit human merge approval.
Independent PR review
fix/task-6332a4b7-inline-image-importatbac20ab)task-6332a4b7Acceptance criteria
slug post importuploads local relative images referenced in Markdown body image syntax.Blocking issues
cli/src/inline-image-import.ts:71filters only the raw Markdown destination, thencli/src/inline-image-import.ts:78decodes it andcli/src/commands.ts:2012resolves it. Encoded separators or traversal such as%2Ftmp%2Fsecret.pngor..%2Foutside.pngcan therefore pass local-image classification and be read/uploaded outside the intended source-relative local image scope. Revalidate the decoded path beforereadMediaUploadFile/upload: reject decoded absolute paths, backslashes/drive-style paths, and..segments (or otherwise constrain resolved paths to the import source tree) while still allowing ordinary encoded filename characters like spaces.Warnings
Final verdict
Changes requested. The main acceptance criteria are covered, but the decoded-path validation gap is a correctness/security blocker before merge.
Independent PR re-review
Summary: Re-reviewed Forgejo PR #294 at
6376e54dcfagainst tasktask-6332a4b7. The decoded-path safety blocker from the prior review is fixed:readLocalImageTokennow validates the decoded local Markdown image path beforepreparePostImportImagesresolves or reads it, rejecting leading/, Windows drive prefixes, backslashes/UNC forms, and..segments, with parser and mocked command regressions covering the cases.Acceptance criteria:
slug post importuploads local relative images referenced in Markdown body image syntax.Blocking issues: none.
Warnings: none.
Final verdict: approved. CI run #500 for
6376e54dcfreports success; local checks were not rerun per review-only instructions.