application-layer firewalls do not just look at the metadata; they also look at the actual data transported. they know how certain protocols work, for example ftp or http. they can then look if the data that is in the packet is valid (for that protocol). if it is not, it can be dropped.