A work machine including: a hydraulic pump that delivers a hydraulic operating fluid, an actuator driven by the hydraulic operating fluid delivered from the hydraulic pump, a directional control valve that controls flow of the hydraulic operating fluid supplied to the actuator, a pilot pump of a fixed displacement type, a solenoid valve that generates a pilot pressure to drive the directional control valve with use of a delivery pressure of the pilot pump as a source pressure, a shut-off valve that interrupts a connection between the pilot pump and the solenoid valve, a first sensor that senses an amount of operation of an operation lever, a second sensor (38, 39) that senses a state amount relating to operation of the solenoid valve, and a controller that controls the solenoid valve and the shut-off valve on a basis of sensing signals of the first sensor and the second sensor (38, 39), characterized in that the controller is configured to: determine whether or not an abnormality of the second sensor (38, 39) exists on a basis of the sensing signal of the second sensor (38, 39), and when determining that the second sensor (38, 39) is abnormal, on a basis of the sensing signal of the first sensor, make an opening command to the shut-off valve if operation of the operation lever is sensed and make a closing command to the shut-off valve if a neutral state of the operation lever is sensed. a hydraulic pump that delivers a hydraulic operating fluid, an actuator driven by the hydraulic operating fluid delivered from the hydraulic pump, a directional control valve that controls flow of the hydraulic operating fluid supplied to the actuator, a pilot pump of a fixed displacement type, a solenoid valve that generates a pilot pressure to drive the directional control valve with use of a delivery pressure of the pilot pump as a source pressure, a shut-off valve that interrupts a connection between the pilot pump and the solenoid valve, a first sensor that senses an amount of operation of an operation lever, a second sensor (38, 39) that senses a state amount relating to operation of the solenoid valve, and a controller that controls the solenoid valve and the shut-off valve on a basis of sensing signals of the first sensor and the second sensor (38, 39), characterized in that the controller is configured to: determine whether or not an abnormality of the second sensor (38, 39) exists on a basis of the sensing signal of the second sensor (38, 39), and when determining that the second sensor (38, 39) is abnormal, on a basis of the sensing signal of the first sensor, make an opening command to the shut-off valve if operation of the operation lever is sensed and make a closing command to the shut-off valve if a neutral state of the operation lever is sensed. determine whether or not an abnormality of the second sensor (38, 39) exists on a basis of the sensing signal of the second sensor (38, 39), and when determining that the second sensor (38, 39) is abnormal, on a basis of the sensing signal of the first sensor, make an opening command to the shut-off valve if operation of the operation lever is sensed and make a closing command to the shut-off valve if a neutral state of the operation lever is sensed.