Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump com.thoughtworks.xstream:xstream from 1.4.20 to 1.4.21 to fix CVE-2024-47072 #5280

Merged
merged 2 commits into from
Nov 18, 2024

Conversation

nisiyong
Copy link
Member

@nisiyong nisiyong commented Nov 16, 2024

What's the purpose of this PR

fix CVE-2024-47072

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

  • New Features

    • Introduced global search functionality for system values.
    • Added REST template client connection pool configuration.
    • Implemented limits and whitelists for namespaces per app ID and cluster.
    • Enabled observation of status access keys for pre-checks and logging.
    • Introduced caching record statistics function for ConfigService.
  • Bug Fixes

    • Resolved issues with duplicate comments and blank lines in configuration.
    • Fixed missing items in the published namespace link.
    • Corrected order of clusters in the envClusters open API.
    • Updated xstream library to address a critical security vulnerability.
  • Refactor

    • Standardized Kebab style in configuration files.
    • Aligned database field lengths for ClusterName and NamespaceName.

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Nov 16, 2024
Copy link
Contributor

coderabbitai bot commented Nov 16, 2024

Walkthrough

The changes in this pull request primarily involve updates to the Apollo version 2.4.0, including new features, fixes, and dependency updates. Key modifications include enhancements to server configuration, the introduction of a REST template client connection pool, and global search capabilities. Fixes address issues with configuration management and namespace links, while new limits and caching functions have been added. The RefreshAdminServerAddressTask has been improved for dynamic configuration, and the xstream library has been updated for security reasons.

Changes

File Change Summary
CHANGES.md Updated for Apollo version 2.4.0 with new features, fixes, and enhancements, including global search, namespace limits, and caching statistics.
pom.xml Updated xstream dependency version from 1.4.20 to 1.4.21 to address CVE-2024-47072.

Possibly related PRs

Suggested labels

size:S, lgtm

🐇 In the fields where rabbits play,
New features hop in, brightening the day.
With limits and fixes, we leap with glee,
A safer, smarter Apollo, oh what a spree!
Let's gather the carrots, the code is now fine,
Hopping along, our future will shine! 🌟


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between a90fb6b and 0f21455.

📒 Files selected for processing (2)
  • CHANGES.md (1 hunks)
  • pom.xml (1 hunks)
🔇 Additional comments (2)
CHANGES.md (1)

23-23: LGTM! The changelog entry accurately documents the security update.

The entry follows the established format and clearly indicates the version bump and the CVE being addressed.

Let's verify if there are any other files that might reference the xstream version:

✅ Verification successful

✅ Version bump to xstream 1.4.21 is correctly implemented

The verification confirms that:

  • The xstream dependency in pom.xml is already updated to version 1.4.21
  • No other instances of version 1.4.20 exist in the codebase except in the changelog entry
  • The dependency update is properly documented with a comment "to fix CVE-2024-47072"
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Search for any other files that might reference the old xstream version
# to ensure complete version bump coverage.

# Search for xstream version references in pom.xml files
echo "Checking pom.xml files for xstream version references:"
rg -l "xstream" -g "pom.xml"

# Search for any direct references to version 1.4.20
echo -e "\nChecking for specific references to the old version 1.4.20:"
rg "1\.4\.20"

# Search for any Maven dependency declarations of xstream
echo -e "\nChecking for xstream dependency declarations:"
ast-grep --pattern 'dependency {
  $$$
  groupId { $$ }
  artifactId { "xstream" }
  $$$
}'

Length of output: 632


Script:

#!/bin/bash
# Let's check the content of pom.xml to see the current xstream version
echo "Checking xstream dependency in pom.xml:"
rg -A 5 -B 5 "xstream" pom.xml

# Also check for any properties defining xstream version
echo -e "\nChecking for xstream version property:"
rg "xstream.*version" pom.xml

Length of output: 607

pom.xml (1)

203-208: Security fix looks good, let's verify the version.

The update to XStream 1.4.21 to address CVE-2024-47072 is appropriate.

Let's verify if this is the latest secure version and check for any breaking changes:

✅ Verification successful

XStream 1.4.21 is the latest version and properly addresses CVE-2024-47072

The verification confirms:

  • 1.4.21 is currently the latest version available on Maven Central
  • This version specifically patches CVE-2024-47072 (DoS via stack overflow)
  • No known high or critical vulnerabilities exist in version 1.4.21
  • No breaking changes were found between 1.4.20 and 1.4.21 in the project documentation
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify XStream version and check for known vulnerabilities

# Check latest version from Maven Central
echo "Latest version from Maven Central:"
curl -s "https://search.maven.org/solrsearch/select?q=g:com.thoughtworks.xstream+AND+a:xstream&rows=1&wt=json" | jq -r '.response.docs[0].latestVersion'

# Check for any known vulnerabilities in version 1.4.21
echo -e "\nChecking for known vulnerabilities in 1.4.21:"
gh api graphql -f query='
{
  securityVulnerabilities(first: 5, ecosystem: MAVEN, package: "com.thoughtworks.xstream:xstream", severities: [CRITICAL, HIGH]) {
    nodes {
      advisory {
        summary
        severity
        publishedAt
      }
      vulnerableVersionRange
      firstPatchedVersion {
        identifier
      }
    }
  }
}'

# Check for any breaking changes between 1.4.20 and 1.4.21
echo -e "\nSearching for potential breaking changes:"
rg -i "breaking.*changes|migration|upgrade" --type md

Length of output: 4138


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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 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.

@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Nov 16, 2024
Copy link
Member

@nobodyiam nobodyiam left a comment

Choose a reason for hiding this comment

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

LGTM

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Nov 18, 2024
@nobodyiam nobodyiam merged commit cdbb8f7 into apolloconfig:master Nov 18, 2024
7 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Nov 18, 2024
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:XS This PR changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants