Foam sealant comes in aerosol cans. This foam is composed of an aerosolized form of polyurethane or a similar material. As foam sealant dries, it hardens and expands, creating a durable bond with surfaces that prevents the penetration of fluids and air. Foam sealants are suitable for closing areas around ducts, pipes, vents, joints between stairs and floors and cracks around windows and doors. Different types of foam sealant are available for use with small and large cracks.
In almost all instances, you should keep foam sealant away from areas of intense heat, including fireplaces. In its aerosolized form, foam sealant is highly flammable. Though the foam sealant becomes less flammable as it dries, hardened foam sealant melts easily at high temperatures. A foam sealant produced by DAP, for instance, works at a maximum temperature of 115 degrees Fahrenheit, making it ill-suited to areas around fireplaces. Dow produces a sealant called Fireblock, which resists high temperatures and prevents the penetration of smoke and fire, which may work around your fireplace, although the company provides no maximum temperature rating for the material.
A fact sheet on controlling air leakage published by the government of Virginia recommends the use of high-temperature sealants in areas such as fireplaces, chimneys and flues. An Iowa State University publication takes this one step further by recommending only high-temperature caulks for such areas. Some caulks, such as mortar caulks, resist extremely high temperatures. Mortar caulks are especially useful if your home contains brick fireplaces, since brick construction almost always contains mortar. Caulk comes in tubes and is applied using a caulking gun.
You should never use a random sealant or caulk lying around your home for high-temperature applications unless the packaging explicitly states that the material resists high temperatures. Inquire at your local hardware store about sealants and caulks designed for high-temperature applications to find the best product for your purpose. If you never build fires in your fireplace, you can use any sealant designed for use with the material of your fireplace. However, you should take additional measures to seal off an unused fireplace, such as placing a glass or plastic seal over the opening.