Jump to content

0.0.0.0

Page semi-protected
From Wikipedia, the free encyclopedia

The Internet Protocol Version 4 (IPv4) address 0.0.0.0 has multiple uses.

Uses

As an outgoing packet

The IP address 0.0.0.0 is used as a source address when the host is still in the process of obtaining its own address, and is not permitted for use as a destination address.[1] For outgoing packets, 0.0.0.0 as the source IP means "this host on this network".[2][1] This behavior is described in section 3.2.1.3 of RFC 1122[3][a], and protocols that use 0.0.0.0 in this way include BOOTP and DHCP.[4][5]

In a BOOTP bootrequest, the client fills in its own known IP address as the source, or 0.0.0.0 if the address is unknown.[6]

In DHCP, a host may use 0.0.0.0 as its own source address when it has not yet been assigned an address, such as when sending the initial DHCPDISCOVER packet when using DHCP.[7] This usage has been replaced with the APIPA mechanism in modern operating systems.[citation needed]

As 0.0.0.0 is of limited use as a source address and prohibited as a destination address, it can be used as a means to prohibit communication with undesirable hosts. For example, a line may be added to an operating systems' hosts file such as 0.0.0.0 example.com, which would route example.com to 0.0.0.0, ensuring all attempts to connect to example.com will fail. In Syslog, 0.0.0.0 is similarly used to prevent communication with the server.[8] This usage can be problematic, as 0.0.0.0 is only an invalid destination in the context of a network: while operating systems are obliged to prevent usage of 0.0.0.0 over the wire, they are still permitted to use it internally. This usage therefore invokes undefined behavior which may differ between systems: for example, Linux routes packets destined for 0.0.0.0 back to the local host.[citation needed]

In Linux, a program that specifies 0.0.0.0 as the destination address will actually connect to localhost.[9] When the Linux kernel encounters a packet with a destination address of 0.0.0.0, which, according to RFC 1122, is treated as having no destination address, the kernel sets the destination address to the source address, effectively routing all packets back to the local host.[10] This process follows guidance on multihoming specified in section 4.2.4.4 of RFC 1122.[11] As this behavior sends packets with destination addresses of 0.0.0.0 over the loopback interface, and never sends them over the wire, the Linux kernel remains in compliance with RFC 1122, which focuses only on interoperability and network behavior rather than how an operating system must handle such addresses internally within the host itself.[citation needed]

Binding

On both Windows and Unix, when selecting which of a host's IP address to use as a source IP, a program may specify INADDR_ANY (0.0.0.0). When a program binds to 0.0.0.0, it accepts connections from any network interface, such as connections from localhost (127.0.0.1), the local area network (such as 192.168.0.0/16), and public IP addresses.[12][13]

Routing

In routing tables, 0.0.0.0 can also appear in the gateway column. This indicates that the destination is directly reachable on a local interface and no next-hop router (gateway) is needed.[14]

The CIDR notation 0.0.0.0/0 defines an IP block containing all possible IP addresses. It is commonly used in routing to depict the default route as a destination subnet. It matches all addresses in the IPv4 address space and is present on most hosts, directed towards a local router.[15]

In IPv6

In IPv6, the all-zeros address is typically represented by :: (two colons), which is the short notation of 0000:0000:0000:0000:0000:0000:0000:0000.[16] The IPv6 variant serves the same purpose as its IPv4 counterpart.[citation needed]

0.0.0.0 day exploit

In August 2024, researchers from Israeli cybersecurity firm Oligo announced that they had discovered a security flaw in which malicious requests from a target's web browser were allowed to reach any port of the 0.0.0.0 address of their target, potentially allowing the browser (and therefore the remote attacker) to access private resources. Depending on which software is configured to be listening on the target's machine, the attackers could exfiltrate internal company information or developer code, or issue requests to the APIs of various software.[17][18]

See also

Notes

  1. RFC 1122 refers to 0.0.0.0 using the notation {0,0}.[1]

References

  1. 1 2 3 IETF 1989, p. 30, 3.2.1.3 Addressing: RFC-791 Section 3.2 "(a) {0, 0}".
  2. IETF 1989, p. 29, 3.2.1.3 Addressing: RFC-791 Section 3.2.
  3. "IANA IPv4 Special-Purpose Address Registry". Internet Assigned Numbers Authority. 19 August 2009. Retrieved 7 June 2023, "Address block 0.0.0.0/32: This host on this network; [RFC1122], Section 3.2.1.3"
  4. William J. Croft; John Gilmore (September 1985). Bootstrap Protocol. IETF. doi:10.17487/RFC0951. RFC 951.
  5. Ralph Droms (March 1997). Dynamic Host Configuration Protocol. IETF. doi:10.17487/RFC2131. RFC 2131.
  6. "RFC 951 Bootstrap Protocol". datatracker.ietf.org. p. 2. Retrieved 7 February 2026, "3. Packet Format: In the IP header of a bootrequest, the client fills in its own IP source address if known, otherwise zero."
  7. "RFC 2131: Dynamic Host Configuration Protocol". 4.1 Constructing and sending DHCP messages.
  8. R. Woundy; K. Marez (December 2006). Cable Device Management Information Base for Data-Over-Cable Service Interface Specification (DOCSIS) Compliant Cable Modems and Cable Modem Termination Systems. Network Working Group. doi:10.17487/RFC4639. RFC 4639. Proposed Standard. p. 32. Obsoletes RFC 2669. Updated by RFC 9141. If 0.0.0.0, either syslog transmission is inhibited, or the Syslog server address is not an IPv4 address.
  9. Kitt, Stephen (26 January 2018). "Connecting to IP 0.0.0.0 succeeds. How? Why?". Stack Exchange. Retrieved 7 June 2023.
  10. "Linux kernel source code: net/ipv4/route.c". elixir.bootlin.com. line 2742.
  11. IETF 1989, p. 108, 4.2.4.4 Multihoming, IMPLEMENTATION.
  12. Kerrisk, Michael (22 March 2021). "ip(7) — Linux manual page". man7.org. Retrieved 7 February 2026, "Special and reserved addresses: INADDR_ANY (0.0.0.0)"
  13. "bind function (winsock.h) - Win32 apps". Microsoft Learn. 19 August 2022. Retrieved 7 June 2023.
  14. Henry-Stocker, Sandra (4 August 2013). "Unix: Getting from here to there (routing basics)". Network World. Retrieved 7 June 2023.
  15. Abraham, Tim (2020). Metabase Up and Running Introduce Business Intelligence and Analytics to Your Company and Make Better Business Decisions (1st ed.).
  16. Das, Kaushik (2008). "IPv6 Addressing". ipv6.com. Archived from the original on 11 April 2015. Retrieved 7 June 2023.
  17. Brewster, Thomas (7 August 2024). "Hackers Have Exploited An 18-Year-Old '0.0.0.0-Day' Loophole In Safari, Chrome And Firefox". Forbes. Retrieved 8 August 2024.
  18. Lyons, Jessica (9 August 2024). "It's 2024 and we're just getting round to stopping browsers insecurely accessing 0.0.0.0". The Register. Retrieved 25 May 2025.

Works cited