Reference in New Issue
Block a user
Delete Branch "fix/security-all"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Security Fixes
This PR fixes 8 security issues across the codebase:
#154: Path traversal prevents writes/deletes outside destination root
realpath()resolution infile_save_to_disk()to prevent symlink-based escapesdelete_extras_walk()to uselstat()instead ofstat()and skip symlinksreceive_incremental_check()andreceive_files()CHECK_BATCH to uselstat()#156: Unbounded wire sizes enable OOM denial of service
receive_str()receive_data()#157: Metadata restoration applies arbitrary mode bits including setuid/setgid
file_restore_metadata()#159: zstd decompression may allocate ZSTD_CONTENTSIZE_UNKNOWN bytes
ZSTD_CONTENTSIZE_UNKNOWN; fall back to conservative (3x compressed) size#160: TLS I/O doesn't handle SSL_ERROR_WANT_READ / SSL_ERROR_WANT_WRITE
SSL_accept()/SSL_connect()retry loop inwrap_fd_with_ssl()#161: TLS client lacks hostname verification
SSL_set1_host()call beforeSSL_connect()to enable hostname verification#162: --delete follows symlinks and may delete outside destination tree
delete_extras_walk()to uselstat()and skip symlinks#170: Delta deserialization doesn't validate array counts from network
Files Changed (9 files, +143/-26)
src/shared/utils.c- lstat + skip symlinks in delete_extras_walksrc/shared/file.c- realpath validation in file_save_to_disk, lstat in receive_incremental_checksrc/shared/protocol.c- bounded string/data sizessrc/shared/protocol.h- MAX_STRING_SIZE/MAX_DATA_PAYLOAD_SIZEsrc/shared/compression.c- ZSTD_CONTENTSIZE_UNKNOWN checksrc/shared/transport_tls.c- SSL WANT_READ/WANT_WRITE retry, SSL_set1_host hostname verificationsrc/shared/delta.c- max block/instruction count validationsrc/server/server.c- lstat in CHECK_BATCH pathtests/integration/test_tls.py- IP SAN in test certificatesPull request closed