Yes, it is cpvc, but that is a special kind of pvc and he could not tell unless he is familiar with what they look like - and it isn't that much different (and he now can see it printed on the pipe).
What probably happened is that the fitting leaked at one time, so someone attempted to tighten it and succeeded in getting it to stop, but then in the process, cracked the cpvc. Cpvc is used in hot water applications and is very tough stuff compared to ordinary pvc, so the actual damage probably happened quite some time ago. Over time the cpvc will sag and put more pressure on the short feed through the wall. If it is not supported somewhere in a fairly long run of like 10 feet or more, it is heavy enough to snap it off in a stressed location like this. Then with perhaps a bit more hot water applied than normal, the line gets hot and damages a little more until it finally breaks off if it is under some tension or a torsion (twist) - all of these can affect it. If possible a support should be fashioned to take the load off the pipe without restricting it from some motion. Like a bottom support at the elbow going to wherever. The washer looks like it was part of the support maybe?
The fix is as described by others - you cut the hole between two studs - if you are careful, you can use the same board to repair the hole afterward. You need access to at least an inch of material at the end of the pipe that you connect onto and it has to extend outward at least another inch to allow for the repair connector to be installed. Then from the repair connector to the nipple is a length of pipe which has to be long enough to insert into the connector and long enough to be inserted into a new nipple which is threaded into the shutoff valve.
After you have all of these dimensions, you have to determine if there is enough room to get the repair in horizontally or whether you will have to go deeper. Assuming that you do not have enough space to make the repair because the faucet will stick out too far, then you will have to consider cutting off the pipe where it comes in farther back from the opening. That would be much harder and entails cutting the pipe prior to the last elbow installed an installing new from there. That is the easiest in some respects, but it is harder if the space is cramped. Hope you don't have to do it that way.
Assuming that there is enough space (there should be although the pictures are not too indicative of it) and you can get at the pipe to clean it and apply the cleaner and glue, this will be the easiest overall to do. So:
1. measure the length of the protruding pipe after it is trimmed flat across the end - the pipe ends into the fittings must be reasonably square.
2. If the length is about an inch, you should be able to get a connector on it successfully.
Do those two first and assemble them dry (do not use glue yet, cleaned mechanically and primed with a pvc cleaner).
3. Then measure the length of pipe needed to get to the shutoff valve by measuring from the outside edge of the connector to the outside edge (nearest the wall) of the shutoff when it is positioned to be connected to the vertical feed to the basin. Add 2 times the diameter of the pipe for the connector slip joint and the slip joint of the nipple (measure the length into the nipple and the connector, they should be the same and about equal to the diameter of the pipe) and 1/2 the length of the threaded portion of the nipple to the length that you measured previously. You can dry assemble these to determine whether you are in the ball park lengthwise.
4. Cut a piece of pipe of the length measured with additions once you have convinced yourself that it will be long enough.
You can use a hack saw, an ordinary copper pipe cutter or even a very sharp knife to cut the pipe - I use a hacksaw with at least 24 teeth per inch. Be careful to cut it straight (a finishing saw in a guide also works very nicely). When finished cutting, use a knife to scrape off the inner and outer edges of the cuts and clear away the saw debris. Clean the surfaces with a cleaner if preferred shortly before applying the solvent glue (cement is more accurate, I guess).
I would use a new shutoff valve of the same kind and a new nipple fixed very tightly with Teflon tape to the shutoff and I mean tight. Assemble the nipple to the shutoff after the short piece of pipe is installed into the nipple. Make sure that you have enough pipe, but not so much that it sticks out too far.
Once you have assembled the connector to the stub and assembled the short replacement pipe to the nipple - allowed them to dry a little (15 minutes), then assemble the nipple/pipe assembly into the shutoff. Use the appropriate wrenches on the shutoff and the nipple - do not twist on the pipe itself.
Now recheck the length - you can shorten some by cutting it off, but it is more difficult to lengthen it. If you are satisfied that the length of pipe when slipped into the connector pipe will be long enough - you are ready to assemble that last joint.
5. When you clean, prime and apply the solvent glue, you will have little chance to get it right.
6. The shutoff pipe must be at 90 degrees upwards - period.
You can practice that a few times dry, but it is harder to turn dry and you might not be able to get it to go all of the way in. With the glue applied, the thing slips easily and turns easier so it should be simple - don't worry if you have to turn it backwards a little, that won't hurt. Just don't do it more than once (you won't get a chance to do it more than once LOL)
7. To achieve the 90 degrees at assembly, you clean and apply cleaner to both the connector and the pipe,
8. then get ready - while you are holding the shutoff in your hand at approximately 45 degrees from vertical apply solvent glue to the connector and then liberally to the pipe,
9. all in one motion, insert the pipe into the connector, turning it slowly as you slide it in until it hits a stop inside, then turn the shutoff to 90 degrees.
If all checks out, give the assembly a 15 minute set time and reassemble the rest - don't pressurize it for awhile. I have been successful using only an hour, but 5 - 24 is better. (the glue can should say). Do not try to tighten the nipple onto the shutoff without great care and two wrenches - it is not worth the risk. Tighten it before the glue is assembled.
When all is done, turn on the pressure - it should not leak.
Then button up the area - consider dressing the opening with a panel so that it can be used again, or spackle and coat with paint - there are instructions available for that elsewhere.