Skip to content

fix: Fix CVE-2023-40481, CVE-2023-31102, and CVE-2022-47069 security …#5

Open
Zeno-sole wants to merge 1 commit intodeepin-community:masterfrom
Zeno-sole:master
Open

fix: Fix CVE-2023-40481, CVE-2023-31102, and CVE-2022-47069 security …#5
Zeno-sole wants to merge 1 commit intodeepin-community:masterfrom
Zeno-sole:master

Conversation

@Zeno-sole
Copy link
Copy Markdown

…vulnerabilities

This commit adds security patches for three CVEs affecting p7zip:

  • CVE-2023-40481: Fix out-of-bounds write in SquashFS file parsing The GetPath function in SquashfsHandler.cpp lacked proper bounds checking when parsing maliciously crafted SquashFS archives. Added validation to ensure the size field doesn't exceed available directory data bounds.

  • CVE-2023-31102: Fix integer underflow in Ppmd7.c The CreateSuccessors function could cause an integer underflow when numPs was decremented from zero, leading to invalid array access. Added a check to ensure numPs > 0 before decrementing.

  • CVE-2022-47069: Fix heap buffer overflow in FindCd function The FindCd function in ZipIn.cpp could access memory outside buffer bounds when parsing malformed ZIP archives. Added bounds checking for pointer arithmetic and offset validation.

Changes:

  • debian/patches/17-fix-CVE-2023-31102.patch: New patch for Ppmd7 underflow
  • debian/patches/18-fix-CVE-2023-40481.patch: New patch for SquashFS bounds check
  • debian/patches/19-fix-CVE-2022-47069.patch: New patch for ZIP buffer overflow
  • debian/patches/series: Updated to include new patches
  • debian/changelog: Updated for version 16.02+dfsg-8deepin2

Log: Fixed CVE-2023-40481, CVE-2023-31102, and CVE-2022-47069 security vulnerabilities

Influence:

  1. Verify patches apply cleanly to p7zip source
  2. Test 7Z archive decompression with PPMd compression
  3. Test SquashFS archive handling
  4. Test ZIP archive processing with various formats
  5. Ensure no regressions in normal archive operations

修复 CVE-2023-40481CVE-2023-31102CVE-2022-47069 安全漏洞

本次提交为 p7zip 的三个 CVE 添加了安全补丁:

  • CVE-2023-40481:修复 SquashFS 文件解析中的越界写入 SquashfsHandler.cpp 中的 GetPath 函数在解析恶意构造的 SquashFS 存档时 缺少适当的边界检查。添加了验证以确保大小字段不超过可用目录数据边界。

  • CVE-2023-31102:修复 Ppmd7.c 中的整数下溢 CreateSuccessors 函数在 numPs 从零递减时可能导致整数下溢,导致无效的 数组访问。添加了在递减之前确保 numPs > 0 的检查。

  • CVE-2022-47069:修复 FindCd 函数中的堆缓冲区溢出 ZipIn.cpp 中的 FindCd 函数在解析格式错误的 ZIP 存档时可能访问缓冲区 边界之外的内存。添加了指针算术的边界检查和偏移量验证。

Log: 修复 CVE-2023-40481CVE-2023-31102CVE-2022-47069 安全漏洞

Influence:

  1. 验证补丁可以干净地应用到 p7zip 源代码
  2. 测试使用 PPMd 压缩的 7Z 存档解压缩
  3. 测试 SquashFS 存档处理
  4. 测试各种格式的 ZIP 存档处理
  5. 确保正常存档操作没有回归

repo: p7zip #master

…vulnerabilities

This commit adds security patches for three CVEs affecting p7zip:

- CVE-2023-40481: Fix out-of-bounds write in SquashFS file parsing
  The GetPath function in SquashfsHandler.cpp lacked proper bounds checking
  when parsing maliciously crafted SquashFS archives. Added validation to
  ensure the size field doesn't exceed available directory data bounds.

- CVE-2023-31102: Fix integer underflow in Ppmd7.c
  The CreateSuccessors function could cause an integer underflow when numPs
  was decremented from zero, leading to invalid array access. Added a check
  to ensure numPs > 0 before decrementing.

- CVE-2022-47069: Fix heap buffer overflow in FindCd function
  The FindCd function in ZipIn.cpp could access memory outside buffer bounds
  when parsing malformed ZIP archives. Added bounds checking for pointer
  arithmetic and offset validation.

Changes:
- debian/patches/17-fix-CVE-2023-31102.patch: New patch for Ppmd7 underflow
- debian/patches/18-fix-CVE-2023-40481.patch: New patch for SquashFS bounds check
- debian/patches/19-fix-CVE-2022-47069.patch: New patch for ZIP buffer overflow
- debian/patches/series: Updated to include new patches
- debian/changelog: Updated for version 16.02+dfsg-8deepin2

Log: Fixed CVE-2023-40481, CVE-2023-31102, and CVE-2022-47069 security vulnerabilities

Influence:
1. Verify patches apply cleanly to p7zip source
2. Test 7Z archive decompression with PPMd compression
3. Test SquashFS archive handling
4. Test ZIP archive processing with various formats
5. Ensure no regressions in normal archive operations

修复 CVE-2023-40481CVE-2023-31102CVE-2022-47069 安全漏洞

本次提交为 p7zip 的三个 CVE 添加了安全补丁:

- CVE-2023-40481:修复 SquashFS 文件解析中的越界写入
  SquashfsHandler.cpp 中的 GetPath 函数在解析恶意构造的 SquashFS 存档时
  缺少适当的边界检查。添加了验证以确保大小字段不超过可用目录数据边界。

- CVE-2023-31102:修复 Ppmd7.c 中的整数下溢
  CreateSuccessors 函数在 numPs 从零递减时可能导致整数下溢,导致无效的
  数组访问。添加了在递减之前确保 numPs > 0 的检查。

- CVE-2022-47069:修复 FindCd 函数中的堆缓冲区溢出
  ZipIn.cpp 中的 FindCd 函数在解析格式错误的 ZIP 存档时可能访问缓冲区
  边界之外的内存。添加了指针算术的边界检查和偏移量验证。

Log: 修复 CVE-2023-40481CVE-2023-31102CVE-2022-47069 安全漏洞

Influence:
1. 验证补丁可以干净地应用到 p7zip 源代码
2. 测试使用 PPMd 压缩的 7Z 存档解压缩
3. 测试 SquashFS 存档处理
4. 测试各种格式的 ZIP 存档处理
5. 确保正常存档操作没有回归

repo: p7zip #master
@github-actions
Copy link
Copy Markdown

TAG Bot

TAG: 16.02+dfsg-8deepin2
EXISTED: no
DISTRIBUTION: UNRELEASED

@deepin-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from zeno-sole. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@Zeno-sole
Copy link
Copy Markdown
Author

/integrate

@github-actions
Copy link
Copy Markdown

AutoIntegrationPr Bot
auto integrate with pr url: deepin-community/Repository-Integration#3761
PrNumber: 3761
PrBranch: auto-integration-23430828042

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants