Skip to content

More various fixes to reports from static analyzers#100

Open
gasbytes wants to merge 1 commit intowolfSSL:masterfrom
gasbytes:2026-04-14-various-fixes
Open

More various fixes to reports from static analyzers#100
gasbytes wants to merge 1 commit intowolfSSL:masterfrom
gasbytes:2026-04-14-various-fixes

Conversation

@gasbytes
Copy link
Copy Markdown
Contributor

  • add esp encapsulation to tcp_send_empty_immediate so pure acks on ipsec
  • basedd connections are not sent in plaintext when the tx fifo is full
  • (and the link layer is being used)
  • add esp encapsulation to tcp_send_zero_wnd_probe so zero_window probes on ipsec-protected connections are not sent in plaintext
  • add esp encapsulation to wolfip_forwad_packet so forwarded ip packets
  • are not sent in plaintext when the egresse interface has esp sa
  • ocnfigureed
  • reset sift-sdown cursor to root on each iteration of
  • timers_binheapp_poop so that skipping cancelled timers does not b reak
  • the min-heap invariant
  • send syn-ack immediately in the listen to syn_rcvd transition instead of deferring it until accept() or the ctrl_rto timer fires.
  • validate arp reply sender ip against broadcast, multicast, zero and own address before caching, matching the existing arp request handler checks
  • deconfigure the offered ip address when dhcp request retries are exhausted so the device does not keep using unconfirmed lease.
  • extend multicast classification tests to cover the 225-239 range and boundaries so mask constant mutations are detected
  • add ssrr source routine drop test to cover 0x89 variant type branch alongside the existing lsrr test
  • add multicast source address test for ip_recv to cover the wolfip_ip_is_multicast branch of the rfc 1122 source validation
  • add multicast sender test for arp request validation to cover the wolfip_ip_is_multicast branch of the cache poisoning guard.
  • add esp encapsulation to tcp_send_reset_reply so rst segments toward esp_protected peers are not sent in plaintext
  • nclude tcp timestamp option in zero-window probes when timestamps are negotiated, per rfc 7323 (around section 3.2)
  • process ack+fin segments in syn_rcvd state per rfc 9293 instead of silently discarding non-pure acks.
  • Compute ICMP TTL exceeded and destination unreachable original packet
  • quote size from the actual IP header length so packets with IP options
  • include the full header plus 8 bytes of transport data.
  • seed ipcounter with a random value at init so ip identification fields on non-df packets are not predictable from zero
  • set the df bit on tcp rst replies to match the normal tcp output patch and prevent ip id observability
  • zero hmac hash buffers on the stack after icv comparison and copy to prevent residual keyed hash output from persisting
  • zero gcm/gmac nonce buffers on the stack after use to prevent residual implicit salt bytes from persisting

@gasbytes gasbytes force-pushed the 2026-04-14-various-fixes branch 2 times, most recently from 7022abc to d0b0188 Compare April 14, 2026 18:27
@gasbytes gasbytes marked this pull request as ready for review April 14, 2026 18:51
@gasbytes gasbytes requested a review from danielinux April 14, 2026 18:51
@gasbytes gasbytes requested a review from philljj April 14, 2026 19:05
Comment thread src/wolfesp.c Outdated
Comment thread src/wolfesp.c Outdated
@gasbytes gasbytes force-pushed the 2026-04-14-various-fixes branch from d0b0188 to a4ab47d Compare April 15, 2026 11:25
@gasbytes gasbytes requested a review from philljj April 15, 2026 17:27
Copy link
Copy Markdown

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Choose a reason for hiding this comment

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

Fenrir Automated Review — PR #100

Scan targets checked: wolfip-bugs, wolfip-compliance, wolfip-defaults, wolfip-mutation, wolfip-proptest, wolfip-src

No new issues found in the changed files. ✅

danielinux
danielinux previously approved these changes Apr 16, 2026
@danielinux danielinux removed their assignment Apr 16, 2026
…psec

- basedd connections are not sent in plaintext when the tx fifo is full
- (and the link layer is being used)
- add esp encapsulation to tcp_send_zero_wnd_probe so zero_window probes on ipsec-protected connections are not sent in plaintext
- add esp encapsulation to wolfip_forwad_packet so forwarded ip packets
- are not sent in plaintext when the egresse interface has esp sa
- ocnfigureed
- reset sift-sdown cursor to root on each iteration of
- timers_binheapp_poop so that skipping cancelled timers does  not b reak
- the min-heap invariant
- send syn-ack immediately in the listen to syn_rcvd transition instead of deferring it until accept() or the ctrl_rto timer fires.
- validate arp reply sender ip against broadcast, multicast, zero and own address before caching, matching the existing arp request handler checks
- deconfigure the offered ip address when dhcp request retries are exhausted so the device does not keep using unconfirmed lease.
- extend multicast classification tests to cover the 225-239 range and boundaries so mask constant mutations are detected
- add ssrr source routine drop test to cover 0x89 variant type branch alongside the existing lsrr test
- add multicast source address test for ip_recv to cover the wolfip_ip_is_multicast branch of the rfc 1122 source validation
- add multicast sender test for arp request validation to cover the wolfip_ip_is_multicast branch of the cache poisoning guard.
- add esp encapsulation to tcp_send_reset_reply so rst segments toward esp_protected peers are not sent in plaintext
- nclude tcp timestamp option in zero-window probes when timestamps are negotiated, per rfc 7323 (around section 3.2)
- process ack+fin segments in syn_rcvd state per rfc 9293 instead of silently discarding non-pure acks.
- Compute ICMP TTL exceeded and destination unreachable original packet
- quote size from the actual IP header length so packets with IP options
- include the full header plus 8 bytes of transport data.
- seed ipcounter with a random value at init so ip identification fields on non-df packets are not predictable from zero
- set the df bit on tcp rst replies to match the normal tcp output patch and prevent ip id observability
- zero hmac hash buffers on the stack after icv comparison and copy to prevent residual keyed hash output from persisting
- zero gcm/gmac nonce buffers on the stack after use to prevent residual implicit salt bytes from persisting
Comment thread src/wolfesp.c

rc = esp_calc_icv_hmac(hash, esp_sa, esp_data, esp_len);
if (rc) {
wc_ForceZero(hash, sizeof(hash));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't think these wc_ForceZero(hash, ...); are needed either. The hash ICVs are public values calculated from public payloads.

If the attacker wants samples of [msg, icv] tuples they can just passively monitor valid ESP traffic.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants