It is well-known (see for instance Oskendal's text) that if $T>0$ and $$b(\cdot,\cdot): [0,T] \times \mathbb{R}^n \rightarrow \mathbb{R}^n~~~~~~\sigma(\cdot,\cdot):[0,T] \times \mathbb{R}^n \rightarrow \mathbb{R}^{n \times m}$$ are measurable functions and for some $C>0$ we have $$|b(t,x)|+|\sigma(t,x)| \leq C(1+|x|)~~\mbox{and}~~|b(t,x)-b(t,y)|+|\sigma(t,x)-\sigma(t,y)| \leq C|x-y|,$$ then there is a unique strong solution to the SDE $$dX_t=b(t,X_t)dt+\sigma(t,X_t)dB_t.$$
I have seen papers/books talk about solving this SDE for $t<\tau_D$ where $\tau_D$ is the first time $X_t$ leaves an open set $D$. In this case, we may only have $b$ and $\sigma$ defined on $[0,T] \times D$. I am wondering what precisely is meant by this.
One interpretation is to extend $b$ and $\sigma$ to functions defined on $[0,T] \times \mathbb{R}^n$ by defining $b(t,x)=\sigma(t,x)=0$ for $x \notin D$, but if we do this we kill the Lipschitz property and no longer are guaranteed uniqueness (intuitively it seems like what happens outside of $D$ should not effect what happens to the process before it leaves $D$, but . . .). Another way is to use something like Kirszbraun's Theorem to extend $b$ and $\sigma$ to Lipschitz functions functions on $[0,T] \times \mathbb{R}^n$, use the existence theorem to find a solution to the SDE and then stop the solution at $\tau_D$. Since there might be multiple ways to extend $b$ and $\sigma$, it's not immediately clear that this solution is unique. I think you can argue if it weren't (at least when $b$, $\sigma$ don't depend on $t$), you could piece together a solution up to time $\tau_D$ and a solution from $\tau_D$ to $T$ to contradict the uniqueness of the solution up until time $T$. This all seems too complicated though.
I am wondering what the "right" way of thinking about this sort of thing is (a reference to a book would be great).
EDIT
In addition to the answer below, there is some interesting discussion on this problem here.
This is the book you want, the review in the first ~50 pages of SDEs in Euclidean spaces covers this issue.