Fix #87: security helper converted into component and improved

Fix #87: security helper improvement

Migrated from #4052
That's why strict comparison is safe to use, isn't it?