The bug
This bug was introduced in 20w11a, and I assume it's a bug since it wasn't in the patch notes.
Hoglins now have an insane attack range, making them pretty much impossible to attack with a sword, without getting damaged yourself.
To reproduce
Try to hit a hoglin with a sword without getting damaged in the process. Compare versions 20w10a and 20w11a.
Related issues
is duplicated by
Comments

The attack range makes sense to me, despite how high it is. If a hoglin faces the player directly, it won't appear to hit from more that 1/8th a block away (when its snout is fully lifted). It was a problem without high attack range, as you can stand inside a hoglin's head without getting hurt, which i added then removed from MC-108937.

the problem is not the range attack, the problem is the hitbox, hoglins attack with the head, and the head doesn't have hitbox, that make impossible attack hoglins when is chassing you because the head is giant and the sword don't reach the body where is allocated the hitbox, test it in creative.
Yea the problem is the attack range, is high, my survival is a little lagy, the reason for the last coment, with one hoglin is tricky but you can counter him, but you take damage ever, when are two or more chasing you... with full diamond you can fight two or tree in big areas (nether don't have many big areas) but with iron, better you run
Anyway, I think that the head should be able to receive damage, it is very large to be transparent, it would help a lot to deal with them
PD: i don't know if is intentional or a bug, but de piglins and hoglins spawn in areas with maximum level of light, this plus the bug with hoglins make infernal the mining in crimson forest, the mobs spawn behind you

@unknown It also makes sense to me that the hoglin's attack range is like this. Though maybe it should be decreased a little.

Hoglins are supposed to be tough. We've done a bunch of minor tweaks for the next snapshot (20w12a), including attack range. But for now we will consider this WAI.

I find this to be an issue as well. Look at the 3 attached videos on the duplicate report; the hoglins are clearly attacking from up to THREE BLOCKS away, AND behind a wall. I cannot imagine that this is what Mojang intended, and I hope they find a good compromise since i know there were issues in the past. But as it stands the attack hitbox makes no sense and is very frustrating to try and combat.

If anyone other than myself find their way to this to see attack range, their range is below 3 but above 2.5 blocks. The only way I've found to safely hit them is if the player is 3 blocks up, and even then you could still be hit if several hoglins bump into each other and give each other a tiny lift.
This might bring back the issue, MC-173050 if this is fixed. In 20w10a, hoglins were alot easier because they were not hitting large mobs properly. Relates to MC-108937.