A program for synchronizing files over a network
Go to file
Michal Ruprich df410d7cbf Fix CVE-2026-43618: integer overflow in compressed-token decoding
Backport upstream commit c44c90e9460c to fix CVE-2026-43618, an integer overflow in compressed-token decoding. The patch adds MAX_TOKEN_INDEX bounds checking and new helper functions (recv_compressed_token_num, recv_compressed_token_run, invalid_compressed_token) to harden the recv_deflated_token decoder against overflow of the rx_token counter. It also caps simple_recv_token literal-block length at CHUNK_SIZE and adds a safety check for NULL data pointers in receiver.c. The patch was adapted for rsync 3.1.3 which only has the zlib decoder (recv_deflated_token), skipping hunks for zstd/lz4 decoders not present in this version.

Upstream patches:

    c44c90e946.patch

Triage Decision Justification: CVE-2026-43618 describes a remote memory disclosure vulnerability via integer overflow in rsync's compressed-token decoding. The receiver's compressed-token decoders accumulated rx_token (a 32-bit signed counter) without overflow checking. A malicious sender could craft a compressed-token stream that walked rx_token past INT32_MAX, leaking process memory contents (environment variables, passwords, heap pointers) and weakening ASLR. Upstream commit c44c90e9460c666c965446a8c0957f0b9fa4c66a on master, authored by Andrew Tridgell on 2026-04-29, directly fixes this vulnerability by: (1) capping rx_token at MAX_TOKEN_INDEX = 0x7ffffffe, (2) introducing shared recv_compressed_token_num() and recv_compressed_token_run() functions with comprehensive validation, (3) rejecting negative or out-of-range token values explicitly, and (4) capping simple_recv_token literal-block length at CHUNK_SIZE. While the patch does not explicitly mention CVE-2026-43618, its commit message exactly describes the vulnerability: 'integer overflow in compressed-token decoding' causing 'remote memory disclosure', matching the CVE summary precisely. Note: RHEL 8 ships rsync 3.1.3 which only has recv_deflated_token() (no zstd/lz4), so the patch will require manual adaptation for the older codebase. The upstream patch also supersedes an earlier precursor commit (359e539a, 'reject negative token values') which is already incorporated into and replaced by the comprehensive c44c90e9 fix.

Resolves: RHEL-174951

Backporting steps:

Successfully backported upstream commit c44c90e9460c666c965446a8c0957f0b9fa4c66a (CVE-2026-43618) to rsync 3.1.3 on c8s.

The upstream patch hardens compressed-token decoding against integer overflow in token.c and adds safety checks in receiver.c. The patch targets a newer rsync version that includes zstd and lz4 compression support (recv_zstd_token and recv_compressed_token functions), which don't exist in v3.1.3.

Conflict resolution:

    Hunks for receiver.c applied cleanly (offset -13 lines).
    Hunks adding the new helper functions (invalid_compressed_token, recv_compressed_token_num, recv_compressed_token_run, MAX_TOKEN_INDEX) and the simple_recv_token CHUNK_SIZE check applied cleanly.
    Hunk #3 (replacing inline token parsing in recv_deflated_token with recv_compressed_token_num call) failed because the v3.1.3 code differs slightly from the newer version (no rx_token < 0 check in original). Manually replaced the old inline token parsing code with the new recv_compressed_token_num(f, flag) call.
    Hunk #4 (r_running case in recv_deflated_token using recv_compressed_token_run) applied cleanly.
    Hunks for recv_zstd_token and recv_compressed_token (lz4) were correctly skipped as those functions don't exist in v3.1.3 - only recv_deflated_token (zlib) is present.

The core security fix (overflow protection via MAX_TOKEN_INDEX bounds checking and the new helper functions) is fully applied to the only compression decoder that exists in this version.
2026-06-15 14:47:10 +02:00
.gitignore Import rpm: c8s 2023-02-27 15:20:42 -05:00
gating.yaml Bring gating.yaml over from Brew dist-git 2023-03-10 11:24:11 -08:00
rsync-3.0.6-iconv-logging.patch Auto sync2gitlab import of rsync-3.1.3-14.el8.src.rpm 2022-05-26 14:14:00 -04:00
rsync-3.1.2-remove-symlinks.patch Auto sync2gitlab import of rsync-3.1.3-14.el8.src.rpm 2022-05-26 14:14:00 -04:00
rsync-3.1.2-vvv-hang.patch Auto sync2gitlab import of rsync-3.1.3-14.el8.src.rpm 2022-05-26 14:14:00 -04:00
rsync-3.1.3-append-check.patch Auto sync2gitlab import of rsync-3.1.3-14.el8.src.rpm 2022-05-26 14:14:00 -04:00
rsync-3.1.3-covscan.patch Auto sync2gitlab import of rsync-3.1.3-14.el8.src.rpm 2022-05-26 14:14:00 -04:00
rsync-3.1.3-cve-2018-25032.patch Auto sync2gitlab import of rsync-3.1.3-16.el8.src.rpm 2022-08-02 20:14:29 +00:00
rsync-3.1.3-cve-2022-29154.patch Auto sync2gitlab import of rsync-3.1.3-19.el8.src.rpm 2022-08-24 22:30:43 +00:00
rsync-3.1.3-cve-2022-37434.patch Auto sync2gitlab import of rsync-3.1.3-19.el8.src.rpm 2022-08-24 22:30:43 +00:00
rsync-3.1.3-cve-2024-12085.patch Resolves: RHEL-70207 - Path traversal vulnerability in rsync 2025-02-03 12:54:22 +01:00
rsync-3.1.3-cve-2024-12087.patch Resolves: RHEL-70207 - Path traversal vulnerability in rsync 2025-02-03 12:54:22 +01:00
rsync-3.1.3-cve-2024-12088.patch Resolves: RHEL-70207 - Path traversal vulnerability in rsync 2025-02-03 12:54:22 +01:00
rsync-3.1.3-cve-2024-12747.patch Resolves: RHEL-70207 - Path traversal vulnerability in rsync 2025-02-03 12:54:22 +01:00
rsync-3.1.3-cve-2025-4638.patch Resolves: RHEL-91519 - Improper Pointer Arithmetic in pcl 2025-05-26 14:31:54 +02:00
rsync-3.1.3-cve-2025-10158.patch Resolves: RHEL-152887 - CVE-2025-10158 - Out of bounds array access via negative index 2026-03-11 14:58:46 +01:00
rsync-3.1.3-cve-2026-41035.patch Fix use-after-free in xattr qsort count 2026-05-07 12:21:15 +02:00
rsync-3.1.3-filtering-rules.patch Auto sync2gitlab import of rsync-3.1.3-19.el8_7.1.src.rpm 2022-11-11 04:15:18 +00:00
rsync-3.1.3-fix-cve-2026-29518-regressions.patch Fix CVE-2026-29518: TOCTOU symlink race in non-chrooted daemon modules 2026-06-14 23:05:48 +02:00
rsync-3.1.3-fix-cve-2026-29518.patch Fix CVE-2026-29518: TOCTOU symlink race in non-chrooted daemon modules 2026-06-14 23:05:48 +02:00
rsync-3.1.3-fix-cve-2026-43618.patch Fix CVE-2026-43618: integer overflow in compressed-token decoding 2026-06-15 14:47:10 +02:00
rsync-3.1.3-ignore-missing.patch Auto sync2gitlab import of rsync-3.1.3-14.el8.src.rpm 2022-05-26 14:14:00 -04:00
rsync-3.1.3-missing-xattr-filter.patch Auto sync2gitlab import of rsync-3.1.3-19.el8_7.1.src.rpm 2022-11-11 04:15:18 +00:00
rsync-3.1.3-skip-compress.patch Auto sync2gitlab import of rsync-3.1.3-14.el8.src.rpm 2022-05-26 14:14:00 -04:00
rsync-3.1.3-sparse-block.patch Auto sync2gitlab import of rsync-3.1.3-17.el8.src.rpm 2022-08-11 18:16:40 +00:00
rsync-3.1.3-trust-sender.patch Resolves: RHEL-52004 - Slowness in rsync due to extra validation steps 2025-05-28 14:52:18 +02:00
rsync-3.1.3-xattr.patch Auto sync2gitlab import of rsync-3.1.3-14.el8.src.rpm 2022-05-26 14:14:00 -04:00
rsync-man.patch Auto sync2gitlab import of rsync-3.1.3-14.el8.src.rpm 2022-05-26 14:14:00 -04:00
rsync.spec Fix CVE-2026-43618: integer overflow in compressed-token decoding 2026-06-15 14:47:10 +02:00
rsyncd.conf Auto sync2gitlab import of rsync-3.1.3-14.el8.src.rpm 2022-05-26 14:14:00 -04:00
rsyncd.service Auto sync2gitlab import of rsync-3.1.3-14.el8.src.rpm 2022-05-26 14:14:00 -04:00
rsyncd.socket Auto sync2gitlab import of rsync-3.1.3-14.el8.src.rpm 2022-05-26 14:14:00 -04:00
rsyncd.sysconfig Auto sync2gitlab import of rsync-3.1.3-14.el8.src.rpm 2022-05-26 14:14:00 -04:00
rsyncd@.service Auto sync2gitlab import of rsync-3.1.3-14.el8.src.rpm 2022-05-26 14:14:00 -04:00
sources Auto sync2gitlab import of rsync-3.1.3-14.el8.src.rpm 2022-05-26 14:14:00 -04:00