I don't even want to ask this question but... several years ago we hired a local contractor to spray high density foam on the roof deck and walls of our unfinished 2nd floor. We realized that the job was done poorly and cut an access into the attic space to assess things. We realize now that they spray foamed directly to the chimney (no flashing). The chimney is currently used for a woodstove and DHW venting. The DHW will go away but wood stove will remain. My question is, how bad (unsafe) is this? I have found information on foam exposure to fire but have not been able to find anything about temperature ratings in general (i.e. what happens on prolonged exposure to high temperatures).
For example, a hybrid solution of spray foam and fiberglass batts or rolls combines the air-sealing and vapor-retarder benefits of foam with the economical thermal performance of fiberglass. Another option might be to install spray foam in places that are hard to reach or seal, such as rim joists, the attic floor, and eaves, and then install fiberglass batts and loose-fill in the in the open areas, greatly reducing any draftiness while helping the project budget. Incorporating spray foam into hybrid solutions enhances the building envelope and seals efficiently at a reasonable cost.  http://youtube.com/e/ggLAUsiuI_o?app=desktop
Installing spray foam is easy to do and can dramatically improve a building or home’s energy efficiency and thermal resistance. Our closed cell foam is so efficient just 3 inches of foam appled inside of wall cavities provides an insulation value of over R18!. Our products are specially formulated for both new construction and existing homes and buildings. http://youtube.com/watch?feature=player_embedded&v=ggLAUsiuI_o

This stuff works GREAT ! I live in an older mobile home that had a lot of leaks when I moved-in. I worked for two years to locate and fix them all. Now I simply go over all of the repaired places once a year just to be sure everything is OK. NO LEAKS FOR 4 YEARS NOW!!  Others here use "sno proof" or something that does not stop leaks. When I tell them about my success, they don't seem to want to pay the$ for this superior product. Too bad!. I used the tape in  repairing the leaks.

Roof coatings can add 25 years to the service life of a roof and reduce the amount of discarded roofing materials that end up in landfills. The infrared image on the right shows 175 °F (79 °C) on the uncoated (black) section of the modified bitumen roof. The coated (white) section is 79 °F (26 °C). Field studies have shown that cool roof coatings can lower rooftop temperatures and reduce air conditioning bills.

Roof Coating