[FIX] ir_attachment: fix security issues on ir_attachment