← Back to Pull requests

[1.9.1] Harden validation, credential handling and diagnostic interfaces #4481

Closed
unknown closed this pull request without merging on Oct 22, 2026 05:33 UTC
View on GitHub
unknown unknown commented on Oct 20, 2026 09:46 UTC
Author

Summary

This draft targets 1.9.1 and groups the following changes for review:

  • Use Secure XML factories while preserving existing DOCTYPE restrictions, and apply the existing XPath guard to aliases.

  • Bind stored notification credential reuse to the corresponding destination fields for Webhook, Telegram, Discord and ntfy; align edit/test behavior and UI handling.

  • Apply the existing JDBC URL safety validator to manually supplied URLs.

  • Restrict monitor configuration export to admin in backend checks, shipped route rules and UI; clarify the existing shared trusted-operator permission model without introducing ownership or tenant isolation.

  • Apply managed-token lifecycle checks to Actuator handler mappings and resolve existing header/query token carriers consistently.

  • Return explicit public status projections without creator/modifier or internal matching labels, while preserving existing public response structure.

  • Remove generic command/script/Python execution from the standalone Bash MCP service, retaining seven fixed diagnostic tools and documenting the narrowed Linux execution environment.
  • Validation performed

  • Verified the handoff ZIP and patch SHA256, applied all 58 paths to exact upstream 1.9.1 baseline 5e050e2d92a1df51537714cda92269a12eb7a618, and passed git diff --check and staged whitespace checks.

  • Java 25.0.2 / Maven 3.9.9: passed the 24-module startup reactor verify with the nine focused test classes below: 125 tests, zero failures/errors/skips. This compiled production and test sources, packaged the selected reactor, and ran its configured forbidden API checks.

  •   mvn -B -pl hertzbeat-startup -am -Dtest=NoticeConfigServiceTest,NoticeReceiverBindingTest,JdbcCommonCollectTest,HttpCollectImplXpathValidationTest,ApiTokenValidationFilterTest,ApiTokenActuatorMappingTest,MonitorsControllerTest,StatusPagePublicProjectionTest,SurenessResourceRuleTest -Dsurefire.failIfNoSpecifiedTests=false -DfailIfNoTests=false -DskipITs verify
      

  • Angular: pnpm install --frozen-lockfile and pnpm build passed with Node 18.20.5 / pnpm 10.9.0. Build reported dependency warnings and an initial bundle budget warning (3.13 MB versus 2 MB).

  • Rust: cargo fmt --check and cargo test --locked passed: 50 tests, zero failures on macOS ARM64.

  • Corrected new-code Checkstyle findings (test naming/spacing and public-record Javadoc) and Rust formatting discovered by these checks.
  • Not yet verified

    This is a draft, not a release-ready claim. The full repository Java test suite and integration tests were not run; Maven selected only the nine named test classes. Angular focused test bundles compiled, but ChromeHeadless repeatedly failed to capture within 60 seconds, so browser tests have no execution result. Real deployed authentication/Actuator behavior, export round trips, status-page UI regressions, Secure XML native packaging compatibility, and Linux diagnostic deployment still need validation. Rust tests passed on macOS; they do not establish Linux deployment compatibility.

    Review boundaries

    The JDBC change reuses the current validator rather than redesigning its policy. Existing validator false positives and unhandled properties remain outside that minimal change. Notification binding does not add redirect or universal provider protection. The permission clarification preserves explicit role boundaries and does not treat documentation as a substitute for security fixes. Fixed MCP diagnostics are not a sandbox; process termination/resource-limit behavior is unchanged.

    No reviewer requests or merge are part of this draft submission.

    AI assistance: used for draft implementation and test iteration.
    Validation above was executed by the agent on the authorized MacBook; human review remains pending.

    Diff: 475 lines (+356 / -119) across 5 files Reviewer: Duansg Review duration: 2627m
    All Vouch review confidence checks passed
    Residual risk 0.18 = Change Risk (0.46) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.46 · 475 lines diff across 5 files
    0.46
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.369
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #4481"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 45.7% (MEDIUM) · Higher = larger blast radius
    45.7%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 18.1% · Safe to merge
    18.1%