MCU push button triggered by electrostatic discharges
It sounds like the internal pull-up resistor isn't working. It's possible the code has accumulated a bug, or maybe the pull-up has got damaged.

Try an external pull-up resistor.

The Discovery board button schematic shows:  


R22 is 0Ω, and so isn't doing anything
R21 is a pull-down, instead of a pull-up, so it is necessary
C22 capacitor as "N/A", which on ST's schematics often means the part
isn't fitted.
R20 - if C22 isn't fitted, then it does nothing.


So, one resistor + switch is equivalent.

Edit:
Noise, triggering the other, unused pins which have no defined state might be an explanation for relatively frequent and random triggering.

Looking at your picture of the project at github, I see that there is main power nearby. Noise may come from that path.

In general it is a good practice to ensure all unused pins are in a known state anyway. Pins might otherwise trigger, or even go into a 'mid-state' where one, or even both of the complementary MOSFET transistors conduct in the 'analogue' region, causing excessive heat. 

You don't say what the main-loads are, but they may make ensuring pin stability, by excluding noise, even harder.

Set unused pins, which are not already wired to ground or power, to a known state using the internal pull-down or pull-up resistors. Leave them as inputs. Be careful to not do this for pins already tied to signals, ground or power. 

You might start with any unused pins which trigger the same interrupt as you are using. 

(You might also consider handling different pin-interrupts just to see if it is affecting more of the MCU. For example you might set an LED if any of the unused pins trigger. This isn't a fix, but is only to help an investigation or analysis.)

Try to ensure this deliberate pin-setting is highlighted/documented so that future changes to the system will not cause any pin to get into conflict with these pull-up/down settings.

Also ...
It might also be worth a test where the solenoid-board, and mains power, is completely removed from the vicinity of the Discovery board, on the small chance that noise is coming via that board. For example, there may be a ground loop.