Ok, I found the solution. Turns out you can hit "Apply" on the boolean modifier to actually apply the effect. Then the modifier is gone and the vertices are created in the cube object. You can do that by hitting this button in the modifier tab:
After exporting the stl looks like expected, great =)