https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43603

--- Comment #6 from Martin Renvoize (ashimema) 
<[email protected]> ---
Created attachment 206594
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206594&action=edit
Bug 43603: Add Koha::ArticleRequest::ScanImport

Adds the matching engine that consumes a batch scan-return zip
archive: locates its idlink.txt/datalink.txt mapping file, and for
each mapped row finds the matching PROCESSING/SCAN
Koha::ArticleRequest, registers the scanned file under Koha's existing
Upload feature (building the Koha::UploadedFile row directly, since
Koha::Uploader is hard-wired to a CGI streaming callback and can't be
reused for a file already on local disk), sets the request's urls, and
completes it.

Row-level failures (no such request, wrong status/format, missing
file, unparsable row, path traversal, or any other row-scoped
exception) are accumulated in the returned errors array and do not
stop processing of the remaining rows. Only zip-level failures
(unreadable archive, no mapping file found) die.

Path traversal is guarded structurally: any mapped row or zip member
name containing a ".." path component is rejected before ever
touching the filesystem, plus a realpath-based containment check once
a file is known to exist (also covers symlink escapes). A naive
post-hoc "does the resolved path still start with the base directory"
string check is not sufficient here - on Unix, File::Spec's
rel2abs/canonpath do not collapse ".." segments, so that check would
never actually catch a "../../etc/passwd"-style row.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to