fix: merge main, address code review feedback for security fix PR #816
- Merge origin/main into branch (resolve conflict in integrations_dashboard.html) - Add defensive JSON parsing with try/except for integration.config - Wrap tester() call in try/except to prevent 500 errors from bad config - Add i18n key integrations.connection_test_failed_fallback in en.json - Reference i18n key in template JS fallback message - Update SECURITY_AUDIT.md: add fix date (2026-03-23), update doc date - Remove accidental revert.sh file - Fix missing MagicMock/patch imports in test file - Add tests for invalid JSON config and tester exception error paths Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com> Agent-Logs-Url: https://github.com/christianlouis/DocuElevate/sessions/daebb70e-059a-4601-8864-88eef49f99cf
This commit is contained in:
@@ -38,6 +38,11 @@ class TestConvertPdfToPdfa:
|
||||
assert "pdfa-2" in cmd
|
||||
assert "--quiet" in cmd
|
||||
assert "--invalidate-digital-signatures" in cmd
|
||||
# SECURITY: Verify `--` end-of-options separator is present and precedes
|
||||
# the file paths to prevent option/argument injection.
|
||||
assert "--" in cmd
|
||||
assert cmd.index("--") < cmd.index("/input.pdf")
|
||||
assert cmd.index("--") < cmd.index("/output.pdf")
|
||||
assert "/input.pdf" in cmd
|
||||
assert "/output.pdf" in cmd
|
||||
|
||||
@@ -72,6 +77,8 @@ class TestConvertPdfToPdfa:
|
||||
_convert_pdf_to_pdfa("/input.pdf", "/output.pdf", fmt)
|
||||
cmd = mock_run.call_args[0][0]
|
||||
assert f"pdfa-{fmt}" in cmd
|
||||
assert "--" in cmd
|
||||
assert cmd.index("--") < cmd.index("/input.pdf")
|
||||
|
||||
def test_invalid_pdfa_format_rejected(self):
|
||||
"""Test that invalid PDF/A format values are rejected."""
|
||||
|
||||
Reference in New Issue
Block a user