Failure of the speed delimiter electronic gizom fitted by the importer or owner, wired to the speed input wire on ecu.
check the ecu for strange boxes wired to it and double check the connections especially is they are scotch locked.
you could try a temporary bypassas the box usually sits inline.this may get the speedo working but you willbelimited to 112mph (which can be over-ridden if chipped

)
or
could be the speedo head unit which is mounted on the back of the clocks, this converts the cable mechanics to electronic magic which then drives the speedo.
You can either change your speedo assay for a new or second hand unit or you could get hold of another cable driven JDM speedo and remove the good sensor from it and fit it to yours.
To do this you will need to remove the speedo assay from the instrument pack and then remove the rear cover where the speedo cable attaches. Behind this you will a tiny plastic cog that is driven by the turning motion of the cable and a very small oblong sensor that is held in place by two screws. This sensor is triggered by the toothed cog & in turn sends a speed signal to the ECU.
The sensor is not available as a spare part from Subaru.
Failure of either can cause speed failure, check engine light and limp mode (4,500rpm)