An actual modern warhead is a pretty dense box of metal. But how much different is that density from an engine block or an electric transformer or whatever? Not too much. Sizes range from ~18" in diameter to ~36" & lengths from 3 to 6 feet. So bigger than a typical home microwave oven, smaller than a typical home refrigerator. With weights from ~200 to ~700 lbs.
It’s a good bet that homebrew terrorist or early NK efforts will be bigger and probably less dense. But still not enormous.
I imagine that if you had a shipping container whose manifest said it was holding only some comfy pillows but weighing it showed the contents weighed 50,000 lbs somebody might notice the discrepancy. I don’t know if that sort of checking is standard.
But given how small / light modern warheads are vs. 40 foot shipping containers that can hold 50K+ lbs of stuff, you can always pack enough feathers and/or lead in there to get whatever density you want.
Or, more usefully, make the manifest describe innocent contents whose density matches whatever you really put in there.
I remember reading that it was more likely that the terrorists would smuggle in components and assemble only once already in the country.
Of course, a port itself might be near or next to a major urban center so setting it off after docking but before unloading might cause sufficient devastation for terroristic purposes*.
*Thats the 20th Watchlist I have just been added to.