fix: add element name validation to prevent path traversal#11
Closed
Koan-Bot wants to merge 7 commits intocern-mig:masterfrom
Closed
fix: add element name validation to prevent path traversal#11Koan-Bot wants to merge 7 commits intocern-mig:masterfrom
Koan-Bot wants to merge 7 commits intocern-mig:masterfrom
Conversation
Fixup pod example
- Rename testsuite.yml → ci.yml with clearer job names - Add concurrency group to cancel stale runs on same ref - Add macOS job (Perl 5.38 + latest) via actions-setup-perl - Add coverage job with Devel::Cover + Coveralls - Clean env vars: RELEASE_TESTING only on author-test job - Rename matrix job from 'perl' to 'linux' for clarity Preserves existing perl-versions matrix (5.10+ with devel). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ci: modernize CI pipeline
Systematic coverage improvement across all modules: - Queue.pm base: constructor validation errors, _require failure, copy independence - Normal.pm: schema validation (17 error cases), non-permissive lock/unlock, purge with temp/lock/obsolete dirs, nlink option, optional fields, binary/string/table data types, hash serialization escaping - Simple.pm: add_ref, add_path, get_path, touch, granularity option, non-permissive lock/unlock, purge with maxlock, error paths - Null.pm: all unsupported methods (get, get_ref, get_path, touch, lock, unlock, remove), add_ref, add_path file removal - Set.pm: duplicate queue, non-DQ object, missing queue removal, mixed queue types 237 → 413 total tests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
test: add 176 new tests covering error paths and edge cases
Simple.pm accepted arbitrary strings as element names in lock(), unlock(), touch(), remove(), get(), get_ref(), and get_path() without validation. This allowed path traversal attacks (e.g., "../../etc/passwd") to read, delete, or manipulate files outside the queue directory. Normal.pm already validated element names via _check_element(), but this function was defined locally. This change: - Moves _check_element() to Queue.pm base class and exports it - Adds validation calls to all 7 Simple.pm methods that accept element names - Adds missing validation to Normal.pm touch() (was also unprotected) - Updates test using non-hex element name to use valid format - Adds 26 new tests (19 Simple + 7 Normal) for validation behavior
2 tasks
Author
|
Superseded by #18 which contains only the relevant changes (this PR was polluted with unrelated fork infrastructure commits). |
Author
|
Superseded by #18 (clean branch from upstream/master, no fork infrastructure noise). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
../../etc/passwdpassed toremove()could delete files outside the queue)_check_element()validation but it was missing ontouch()Changes
_check_element()from Normal.pm to Queue.pm base class (shared utility)lock(),unlock(),touch(),remove(),get(),get_ref(),get_path()touch()Test plan
dief()🤖 Generated by Kōan