From Wikipedia:
The United States Food and Drug Administration (FDA) has categorized castor oil as "generally recognized as safe and effective" (GRASE) for over-the-counter use as a laxative, with its major site of action the small intestine.[15] Although it may be used for constipation, it is not a preferred treatment, because it can produce painful cramps, fecal incontinence and explosive diarrhea. Its action can go on for hours, sometimes unpredictably and powerfully causing an involuntary bowel movement at inconvenient locations and during sleep.