Normally that doesn't happen if everything is set up properly. Also, the invisible box isn't a bad idea, a lot of games use that same technique.
Can you check and make sure that the collision polygon for your character is the same for each frame? If your character has an animation playing but the collision polygon changes during the animation, the character won't stay still when touching the wall.
To fix this, simply pick the smallest (lowest width/height) frame, and set the collision polygon of each frame to that of the smallest one.
If your character doesn’t have an animation, the issue might stem from a different problem. In that case a project file would be useful.