security: replace string eval with safe module loading#17
Draft
Koan-Bot wants to merge 1 commit into
Draft
Conversation
Replace `eval qq{ require $pkg }` with path-based `eval { require $file }`
in API.pm and Service.pm to eliminate string eval code injection vectors.
Replace symbolic reference string eval in DataAsYaml.pm with explicit
`no strict 'refs'` block.
Also remove defunct .travis.yml (superseded by GitHub Actions CI) and
add common patterns to .gitignore (.env*, .DS_Store, IDE directories).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
7 tasks
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.
What
Replace unsafe string
evalpatterns with safe alternatives across three modules.Why
eval qq{ require $pkg }performs string evaluation — if$pkgever containsinjected content, it becomes arbitrary code execution. While current inputs come
from internal config (low practical risk), the pattern is objectively unsafe and
unnecessary. Perl's
requireaccepts file paths directly viaeval { require $file }.How
eval qq{ require $pkg; 1 }→eval { require $file; 1 }(path-based)eval '\*' . $pkg . '::DATA'→do { no strict 'refs'; \*{"${pkg}::DATA"} }.travis.yml(superseded by GitHub Actions in PR ci: add GitHub Actions CI workflow #6).env*,.DS_Store, IDE directories to.gitignoreTesting
Full test suite passes (
make test). No behavioral change — only the eval mechanism differs.Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com
Quality Report
Changes: 5 files changed, 12 insertions(+), 35 deletions(-)
Code scan: clean
Tests: passed (OK)
Branch hygiene: clean
Generated by Kōan post-mission quality pipeline