Skip to content

Remediate insecure auth/XML patterns and bump H2 to patched version - #129

Draft
patrick-vuong with Copilot wants to merge 2 commits into
mainfrom
copilot/remedate-static-code-issues
Draft

Remediate insecure auth/XML patterns and bump H2 to patched version#129
patrick-vuong with Copilot wants to merge 2 commits into
mainfrom
copilot/remedate-static-code-issues

Conversation

Copilot AI commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

This PR addresses the security remediation issue by removing common static-analysis findings in application code and updating a vulnerable direct dependency. Scope is intentionally narrow: auth/token generation, XML parsing hardening, and a single dependency version bump.

  • Auth service hardening (WizardAuthService)

    • Replaced weak primitives:
      • RandomSecureRandom
      • MD5SHA-256
    • Standardized hashing input encoding to UTF-8.
    • Kept output format stable (hex hash, wizardId-token session token shape).
  • XML import hardening (WizardImportResource)

    • Locked down DocumentBuilderFactory to prevent XXE/entity expansion attacks:
      • secure processing enabled
      • DOCTYPE disallowed
      • external entities/DTD/schema access disabled
      • XInclude and entity expansion disabled
  • Vulnerable dependency remediation

    • Updated direct dependency: com.h2database:h2 from 2.2.224 to 2.3.232.
  • Focused regression coverage

    • Added targeted tests for:
      • SHA-256 hash characteristics and token suffix format
      • successful XML import for valid payloads
      • rejection of DOCTYPE-based XML payloads
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
factory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
factory.setFeature("http://xml.org/sax/features/external-general-entities", false);
factory.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, "");
factory.setAttribute(XMLConstants.ACCESS_EXTERNAL_SCHEMA, "");

This change was produced with Moderne CLI and Moderne Agent Tools (MCP), informed by Moderne Prethink context (dependencies, test gaps, project identity).

Copilot AI review requested due to automatic review settings July 27, 2026 15:31

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because there is no eligible user to bill. To allow Copilot reviews on bot-authored pull requests, enable direct organization billing in your organization's Copilot settings.

Copilot AI linked an issue Jul 27, 2026 that may be closed by this pull request
Co-authored-by: patrick-vuong <107423518+patrick-vuong@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 27, 2026 15:36

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because there is no eligible user to bill. To allow Copilot reviews on bot-authored pull requests, enable direct organization billing in your organization's Copilot settings.

Copilot AI changed the title [WIP] Remediate common static code issues and vulnerable dependencies Remediate insecure auth/XML patterns and bump H2 to patched version Jul 27, 2026
Copilot AI requested a review from patrick-vuong July 27, 2026 15:37
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.

Security Remediation

3 participants