You worry for good reason. You should never have insulation in contact with a wood stove flue pipe.
- Most code jurisdictions require the stove pipe be routed through a thimble to provide a safe distance from combustible materials.
- Air traveling over the surface of the flue pipe may be required to keep it safe and cool.
If your situation is different and sealant is allowed you should use one that is rated (fire) for high temperatures. Foams or sealants rated (www.dap.com) as fire stop are typically orange or red in color so code officials know it is an approved product.