The first thing to find out is if there's underlying medical conditions for the lack of body mass. It might be unlikely if there's no constant problematic weight loss, just a general long-term low body mass, but only a medical practitioner is in a position to determine this. Any conditions could affect the safety of exercise.
In the absence of such conditions, I'd say it's quite the opposite. Resistance training is an outstanding way of gaining body mass; muscle hypertrophy, increased bone density and, if wanted and a large caloric surplus can be tolerated, an increase in body fat. It must be understood that gains in lean body mass will be slow and require a lot of time, as well as a lot of food.
What possible risks I can think of are attempting a training load that exceeds the body's capabilities for supporting (either because of skeletal muscle or bone density and structure), or a volume or progression that exceeds the capacity for recovery. But that's what any decent beginner routine is for. Start every exercise at a weight with which it can be performed with good form and used to learn that form in the first place. Then focus on linear progression in realistic increments while respecting the rest days and getting the sleep and nutrition required for driving such progress. For an underweight female trainee the increments might need to be small, but linear progression can still be done and should yield good results for someone who is untrained.
What is probably most important to avoid injury, whether resistance or endurance training is used, is to make it clear a workout shouldn't be considered "good" on the basis of being exhausted at the end or working to failure. Start with manageable weights, volume or (for cardio) time/distance that feels easy enough. Increment a bit per workout, no too dramatic jumps. The point at which workouts start getting challenging and spur adaptation will manifest itself soon enough. I'd say for increasing body mass, strength training would be the best choice, combined with eating like you mean it.