>>1471974My logitech M720 mouse semi-randomly scrolls pages if I set the scroll wheel to smoth scrolling. The mouse has a button to allow detent rolling or smooth rolling of the wheel. Apparently, without detents, it's possible to roll that wheel to a position where it is between two sensing positions, thus the gets signals up or down at random, thus causing the forward or backward motion of the webpage.
But your problem is with the extra thumb buttons. Run your mouse software again and add the specific program Firefox to the list of programs you can customize your mouse buttons for. Then set your mouse buttons for that program. If that doesn't work, then disable those buttons for the general desktop (no functions assigned to either button) and only set it specifically for Firefox.