Skip to content

fix: Bump h2database and snakeyaml version#5406

Merged
hezhangjian merged 1 commit intoapolloconfig:masterfrom
arrow1991:master
Jun 12, 2025
Merged

fix: Bump h2database and snakeyaml version#5406
hezhangjian merged 1 commit intoapolloconfig:masterfrom
arrow1991:master

Conversation

@arrow1991
Copy link
Contributor

@arrow1991 arrow1991 commented Jun 11, 2025

What's the purpose of this PR

Fixes CVE-2022-45868
Fixes CVE-2022-1471

Brief changelog

Resolves issue #5386

Follow this checklist to help us incorporate your contribution quickly and easily:

  • [√] Read the Contributing Guide before making this pull request.
  • [√] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit tests to verify the code.
  • [√] Run mvn clean test to make sure this pull request doesn't break anything.
  • [√] Update the CHANGES log.

Summary by CodeRabbit

  • Bug Fixes
    • Updated H2 database and SnakeYAML library versions to address known security vulnerabilities.
  • Documentation
    • Added release note about dependency updates and security fixes.

* build(deps): bump com.h2database:h2 from 2.1.214 to 2.2.220

* build(deps): bump org.yaml:snakeyaml from 1.3.4 to 2.3
@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Jun 11, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 11, 2025

Walkthrough

The changes update the pom.xml to specify newer, secure versions of the H2 database and SnakeYAML dependencies, addressing specific security vulnerabilities. The YAML instantiation logic in ItemController.java is adjusted to use the updated SnakeYAML API. A note documenting the dependency updates is added to the CHANGES.md file.

Changes

File(s) Change Summary
CHANGES.md Added a release note line documenting the H2 and SnakeYAML dependency version bumps.
apollo-portal/.../ItemController.java Updated YAML instantiation to use new SnakeYAML API with explicit options for constructor and representer.
pom.xml Added/updated properties and dependency management for H2 (2.2.220) and SnakeYAML (2.3) to fix CVEs.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant ItemController
    participant SnakeYAML

    User->>ItemController: Request to process YAML
    ItemController->>SnakeYAML: Instantiate Yaml with LoaderOptions and DumperOptions
    SnakeYAML-->>ItemController: Yaml instance (with secure configuration)
    ItemController-->>User: Processed YAML response
Loading

Suggested labels

lgtm

Suggested reviewers

  • nobodyiam

Poem

A hop and a skip, new versions in tow,
H2 and SnakeYAML—security aglow!
With options set right, YAML’s parsed with delight,
Bugs and CVEs now vanish from sight.
In the garden of code, safe dependencies grow! 🥕✨

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
CHANGES.md (1)

17-17: Use consistent release note labels for security fixes.
Other security-related entries use the [Security: ...] tag. Consider renaming this line for consistency:

-* [Fix: Bump h2database and snakeyaml version](https://github.com/apolloconfig/apollo/pull/5406)
+* [Security: Bump h2database and snakeyaml version](https://github.com/apolloconfig/apollo/pull/5406)
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f4dc94e and e42d13d.

📒 Files selected for processing (3)
  • CHANGES.md (1 hunks)
  • apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/ItemController.java (1 hunks)
  • pom.xml (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build (8)
🔇 Additional comments (3)
pom.xml (2)

79-81: Properties version bump aligned with CVE fixes.
Added h2database.version and snakeyaml.version to centralize the updated, secure versions addressing CVE-2022-45868 and CVE-2022-1471.


205-216: Manage H2 and SnakeYAML versions in dependencyManagement.
The new entries for com.h2database:h2:${h2database.version} and org.yaml:snakeyaml:${snakeyaml.version} correctly enforce the bumped versions across all modules without altering runtime dependencies at the parent POM level.

apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/ItemController.java (1)

270-273: Explicit YAML configuration with SafeConstructor and DumperOptions.
Instantiating DumperOptions and passing both loaderOptions and dumperOptions into the Yaml constructor ensures duplicate keys are disallowed and dumping behavior is controlled under SnakeYAML v2.3’s API.

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jun 12, 2025
@hezhangjian hezhangjian merged commit 17084ea into apolloconfig:master Jun 12, 2025
8 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jun 12, 2025
@nobodyiam nobodyiam added this to the 2.5.0 milestone Feb 19, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

lgtm This PR has been approved by a maintainer size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments