Wireless ad hoc networks are so vulnerable to passive attacks and eavesdropping adversaries due to their shared medium which makes network traffic easy to capture and analyze. Therefore, security and privacy protections are of extreme importance for protocols and applications in such networks. In this paper, we introduce a new framework for anonymous routing, named chain-based routing, to improve the privacy. In our framework, nodes on a path are virtually bound to each other like a chain. Each node is only aware of its associated links in a flow and does not require any other information about source, destination, or other parts of the chain. Based on this framework, we propose an on-demand routing protocol, called Chain-based Anonymous Routing (CAR), which uses unicast-based broadcast data transfer to fulfill anonymous communication in wireless ad hoc networks. Through hiding identifiers of nodes inside the chain, CAR realizes sender, receiver, and relationship anonymity in addition to untraceability in the network. Moreover, it is resistant to a wide range of passive attacks while adapting to implement other security mechanisms in the presence of active attacks.