Commit bbbb5f7
fix: use the correct RFC 6052 layout for NAT64 /48 local-use addresses
The NAT64 match covered all of 64:ff9b::/32 but always read the embedded IPv4
from the low 32 bits. That is the layout for the well-known 64:ff9b::/96 prefix
only. For the RFC 8215 local-use prefix 64:ff9b:1::/48, RFC 6052 places the IPv4
in bytes 6-7 and 9-10 (byte 8 is the reserved u-octet).
Reading the low bits for a /48 address is wrong in both directions: a /48 address
embedding an internal destination while carrying a routable value in its low 32
bits was read as routable and allowed through, and a /48 address embedding a
routable destination whose low bits are zero was misread as 0.0.0.0 and blocked.
Split the match into the well-known /96 (which now also requires bytes 4-11 to be
zero) and the local-use /48, and reassemble the /48 IPv4 from its correct bytes.
Other RFC 6052 prefix lengths use a Network-Specific Prefix that cannot be
recognized from the address alone and remain out of scope, as noted.
Tests confirmed red against the pre-fix source (2 bypass cases, 1 over-block).
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>1 parent ec4186d commit bbbb5f7
2 files changed
Lines changed: 58 additions & 9 deletions
File tree
- app/server/appsmith-interfaces/src
- main/java/com/appsmith/util
- test/java/com/appsmith/util
Lines changed: 44 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
803 | 803 | | |
804 | 804 | | |
805 | 805 | | |
806 | | - | |
807 | | - | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
808 | 809 | | |
809 | 810 | | |
810 | 811 | | |
811 | 812 | | |
812 | 813 | | |
813 | | - | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
814 | 817 | | |
815 | 818 | | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
816 | 826 | | |
817 | 827 | | |
818 | 828 | | |
| |||
851 | 861 | | |
852 | 862 | | |
853 | 863 | | |
854 | | - | |
855 | | - | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
856 | 892 | | |
857 | 893 | | |
858 | 894 | | |
859 | | - | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
860 | 898 | | |
861 | 899 | | |
862 | 900 | | |
| |||
Lines changed: 14 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
218 | | - | |
219 | | - | |
220 | | - | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
221 | 228 | | |
222 | 229 | | |
223 | 230 | | |
| |||
257 | 264 | | |
258 | 265 | | |
259 | 266 | | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
260 | 271 | | |
261 | 272 | | |
262 | 273 | | |
| |||
0 commit comments