As long as the 7 year old and 8 year old boys do not touch the 10 year old female cousin or engage in any sexual activity while in the bathtub then there's nothing wrong with them bathing together.
Although myself I would not be comfortable bathing with any boys that were related to me as a female.
However I did as a kid bathe with my brother and I'm female as my mom would bathe me and him together when I was 8 years old and he was 6 years old.
I was not very comfortable with it myself then but nothing bad happened.
My mom was just bathing us together to save time.
As long as nothing sexual is going on between the 10 year old female cousin and the 7 year old nephew or the 8 year old nephew then the simple act of bathing together is not wrong or illegal.
If they are all comfortable being naked around each other and comfortable taking a bath together then it's okay.
Family used to bathe together years ago which was normal and even male and female relatives especially as kids.