From e365ac2ea69970f4879608f9dafa5ca40acd9ff9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 29 Oct 2026 17:28:46 +0000 Subject: [PATCH 1/4] Bump zizmorcore/zizmor-action from 0.6.4 to 0.7.1 Bumps [zizmorcore/zizmor-action](https://github.com/zizmorcore/zizmor-action) from 0.6.4 to 0.7.1. - [Release notes](https://github.com/zizmorcore/zizmor-action/releases) - [Commits](https://github.com/zizmorcore/zizmor-action/compare/cc914d7f3750a2d13d75c7f184a1060aa0e9d482...85b2b9fb8e3325e7a23d7d0a9d7ba5ae0f999e3e) --- updated-dependencies: - dependency-name: zizmorcore/zizmor-action dependency-version: 0.7.1 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/zizmor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/zizmor.yml b/.github/workflows/zizmor.yml index d6d4cac..97c8ff8 100644 --- a/.github/workflows/zizmor.yml +++ b/.github/workflows/zizmor.yml @@ -18,7 +18,7 @@ jobs: with: persist-credentials: false - name: Audit GitHub Actions workflows - uses: zizmorcore/zizmor-action@cc914d7f3750a2d13d75c7f184a1060aa0e9d482 # v0.6.4 + uses: zizmorcore/zizmor-action@85b2b9fb8e3325e7a23d7d0a9d7ba5ae0f999e3e # v0.7.1 with: advanced-security: false annotations: true From 8c0ec3276a968cb73c1127e285eee86ddb7c6654 Mon Sep 17 00:00:00 2001 From: ydah Date: Wed, 4 Nov 2026 10:37:21 +0900 Subject: [PATCH 2/4] Restrict IPv4 multicast filters to Class D destinations --- lib/redhound/filter/codegen.rb | 2 +- spec/unit/filter/compiler_spec.rb | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/redhound/filter/codegen.rb b/lib/redhound/filter/codegen.rb index fe87a41..c7b2dec 100644 --- a/lib/redhound/filter/codegen.rb +++ b/lib/redhound/filter/codegen.rb @@ -257,7 +257,7 @@ def broadcast(proto, type, position) if proto == 'ip6' return conjunction(family('ip6'), test(network + 24, 1, :eq, 0xff)) end - condition = type == :broadcast ? disjunction(test(network + 16, 4, :eq, 0), test(network + 16, 4, :eq, 0xffffffff)) : test(network + 16, 1, :ge, 0xe0) + condition = type == :broadcast ? disjunction(test(network + 16, 4, :eq, 0), test(network + 16, 4, :eq, 0xffffffff)) : conjunction(test(network + 16, 1, :ge, 0xe0), test(network + 16, 1, :le, 0xef)) conjunction(family('ip'), condition) end diff --git a/spec/unit/filter/compiler_spec.rb b/spec/unit/filter/compiler_spec.rb index ec288bd..a2187ef 100644 --- a/spec/unit/filter/compiler_spec.rb +++ b/spec/unit/filter/compiler_spec.rb @@ -24,6 +24,14 @@ def filter_packet(data, linktype: 1, length: data.bytesize, meta: {}) expect(described_class.compile('not tcp and udp').match?(dns)).to be true end + it 'restricts IPv4 multicast to the 224.0.0.0/4 destination range' do + program = described_class.compile('ip multicast') + %w[223.255.255.255 224.0.0.0 239.255.255.255 240.0.0.0 255.255.255.255].each do |destination| + packet = filter_packet(ether(ipv4(udp('x'.b), dst: destination))) + expect(program.match?(packet)).to eq(destination.start_with?('224.', '239.')) + end + end + it 'rejects noninitial IPv4 fragments for transport offsets' do fragment = ether(ipv4(udp('x'.b))) fragment[20, 2] = [1].pack('n') From 4a00cfa6e205055933ab4cfe28337aeca61a4bf0 Mon Sep 17 00:00:00 2001 From: ydah Date: Wed, 4 Nov 2026 10:38:58 +0900 Subject: [PATCH 3/4] Stream fixture captures to sandboxed tshark --- spec/differential/analysis_spec.rb | 2 +- spec/differential/network_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/differential/analysis_spec.rb b/spec/differential/analysis_spec.rb index eb74e49..e9757fc 100644 --- a/spec/differential/analysis_spec.rb +++ b/spec/differential/analysis_spec.rb @@ -11,7 +11,7 @@ def corpus(name) = File.expand_path("../fixtures/pcap/analysis-#{name}.pcap", __dir__) def tshark(name, *arguments) - output, error, status = Open3.capture3('tshark', '-n', '-r', corpus(name), *arguments) + output, error, status = Open3.capture3('tshark', '-n', '-r', '-', *arguments, stdin_data: File.binread(corpus(name)), binmode: true) expect(status.success?).to be(true), error output end diff --git a/spec/differential/network_spec.rb b/spec/differential/network_spec.rb index 997a15f..24b2c37 100644 --- a/spec/differential/network_spec.rb +++ b/spec/differential/network_spec.rb @@ -91,7 +91,7 @@ def compare_network(packet, reference) it 'matches every network family, options, embedded packets and tunnels in the committed corpus' do path = File.expand_path('../fixtures/pcap/network.pcap', __dir__) packets = Redhound.open(path).to_a - json, error, status = Open3.capture3('tshark', '-n', '-r', path, '-T', 'json', '--no-duplicate-keys') + json, error, status = Open3.capture3('tshark', '-n', '-r', '-', '-T', 'json', '--no-duplicate-keys', stdin_data: File.binread(path), binmode: true) expect(status.success?).to be(true), error reference = JSON.parse(json) expect(reference.length).to eq(packets.length) From dc99b81c221b28de3ccf667bc4a12c6c21626042 Mon Sep 17 00:00:00 2001 From: ydah Date: Wed, 4 Nov 2026 14:34:58 +0900 Subject: [PATCH 4/4] Normalize tshark metadata in differential comparisons --- spec/differential/analysis_spec.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/spec/differential/analysis_spec.rb b/spec/differential/analysis_spec.rb index e9757fc..12dd3e5 100644 --- a/spec/differential/analysis_spec.rb +++ b/spec/differential/analysis_spec.rb @@ -160,6 +160,7 @@ def reference_endpoint(text, type) reference = tshark(:stats, '-q', '-z', "endpoints,#{type}").lines.filter_map do |line| parts = line.split next unless parts[0]&.match?(/\A[0-9a-f:.]+\z/) && parts[1]&.match?(/\A\d+\z/) + parts = parts.reject { |part| part == 'bytes' } address = parts.shift port = %i[tcp udp].include?(type) ? parts.shift.to_i : 0 [ [address, port], parts.drop(2).map(&:to_i) ] @@ -190,9 +191,13 @@ def reference_endpoint(text, type) path = path.take(depth) + [match[2] == 'ip' ? :ipv4 : match[2].to_sym] [path, [match[3].to_i, match[4].to_i]] end.to_h - session, = analyzed(:stats, stats: ['io,1', 'phs']) + session, packets = analyzed(:stats, stats: ['io,1', 'phs']) actual_intervals = session.statistics[0].to_h[:rows].to_h { |row| [row[:interval], row.values_at(:packets, :bytes)] } - actual_hierarchy = session.statistics[1].to_h[:rows].to_h { |row| [row[:path], row.values_at(:packets, :bytes)] } + # TShark includes frame metadata above the dissected protocol layers. + actual_hierarchy = { [:frame] => [packets.length, packets.sum(&:original_length)] } + session.statistics[1].to_h[:rows].each do |row| + actual_hierarchy[[:frame, *row[:path]]] = row.values_at(:packets, :bytes) + end expect(actual_intervals).to eq(intervals) expect(actual_hierarchy).to eq(hierarchy) session.finish(StringIO.new, StringIO.new)