A colostomy bag is a medical device used to collect waste from the body when a person is unable to pass stool through the rectum due to a medical condition or surgery. It's attached to a stoma, which is an opening created surgically in the abdominal wall.