Skip to content

fix(web): prevent script injection in native directory picker - #336

Open
devdudumuniz wants to merge 2 commits into
AlertaDengue:mainfrom
devdudumuniz:security/native-dir-picker-arguments
Open

fix(web): prevent script injection in native directory picker#336
devdudumuniz wants to merge 2 commits into
AlertaDengue:mainfrom
devdudumuniz:security/native-dir-picker-arguments

Conversation

@devdudumuniz

@devdudumuniz devdudumuniz commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • move the native directory picker into a testable module
  • pass Windows and macOS dialog values through the child environment instead of interpolating them into interpreter source
  • preserve Linux argument-based execution

Security

User-controlled title and path values are no longer embedded in PowerShell or AppleScript source.

Validation

  • pytest -q pysus/tests/web/test_native_dir_picker.py
  • black --check pysus/native_dir_picker.py pysus/web/pages/1_client.py pysus/tests/web/test_native_dir_picker.py
  • flake8 pysus/native_dir_picker.py pysus/web/pages/1_client.py pysus/tests/web/test_native_dir_picker.py
  • official CI: 13 checks passed

@devdudumuniz
devdudumuniz force-pushed the security/native-dir-picker-arguments branch from af630d9 to 716fcca Compare August 30, 2026 01:30
@codecov-commenter

codecov-commenter commented Aug 30, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@2102ba2). Learn more about missing BASE report.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #336   +/-   ##
=======================================
  Coverage        ?   95.25%           
=======================================
  Files           ?      171           
  Lines           ?    20103           
  Branches        ?        0           
=======================================
  Hits            ?    19150           
  Misses          ?      953           
  Partials        ?        0           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@devdudumuniz

Copy link
Copy Markdown
Contributor Author

@luabida, when convenient, could you review this contribution and the two companion PRs, #337 and #338? They are intentionally separate by scope (security, DBF decoding performance, and web UX), are mergeable, and all 15 checks pass on each PR. I am available to adjust any of them based on your review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants