A controller for an internal combustion engine that includes a catalyst (17, 27; 117; 217; 317A, 317B; 417; 517) that is provided in an exhaust passage (15, 25; 115; 215; 315; 415; 515), a fuel addition valve (16, 26; 116A, 116B; 216; 316; 416; 516) that is provided upstream of the catalyst in the exhaust passage and configured to supply fuel to the catalyst, a fuel injection valve (14, 24; 114; 214; 314; 414) configured to inject fuel into a cylinder, temperature increase detecting means (51, 52; 61, 62; 153; 253; 353A, 353B; 453; 553) configured to detect an increase in temperature of the catalyst, and air-fuel ratio detecting means (71, 171, 271, 371, 471, 571) that is provided downstream of the catalyst in the exhaust passage and that is configured to detect the air-fuel ratio of exhaust gas, the controller being configured so that: the fuel injection valve (14, 24; 114; 214; 314; 414) injects fuel into a cylinder at a timing at which the fuel does not contribute to combustion of the internal combustion engine to thereby supply unburned fuel to the catalyst; the temperature increase detecting means (51, 52; 61, 62; 153; 253; 353A, 353B; 453; 553) detects an increase in temperature of the catalyst in response to fuel supplied by the fuel addition valve or the fuel injection valve; and the controller comprising diagnostic means (40, 140, 240, 340, 440, 540) that is configured to diagnose whether the catalyst and/or the fuel addition valve are abnormal on the basis of whether the degree of increase in temperature of the catalyst in response to a fuel supply command for supplying fuel, which is output to the fuel addition valve by the diagnostic means, reflects the supplied fuel and whether the degree of increase in temperature of the catalyst in response to a fuel supply command for supplying fuel, which is output to the fuel injection valve by the diagnostic means, reflects the supplied fuel at the time of the diagnosis, wherein the diagnostic means is configured to diagnose that the catalyst is normal and the fuel addition valve is abnormal when the degree of increase in temperature of the catalyst in response to a fuel supply command for supplying fuel, which is output to the fuel addition valve by the diagnostic means, does not reflect the supplied fuel and when the degree of increase in temperature of the catalyst in response to a fuel supply command for supplying fuel, which is output to the fuel injection valve by the diagnostic means, reflects the supplied fuel at the time of the diagnosis; the controller for an internal combustion engine being characterized in that the diagnostic means is further configured to diagnose that the catalyst is abnormal and the fuel addition valve is normal when the degree of increase in temperature of the catalyst in response to a fuel supply command for supplying fuel, which is output to the fuel addition valve by the diagnostic means, does not reflect the supplied fuel and when the degree of change in air-fuel ratio of the exhaust gas in response to the output fuel supply command reflects the supplied fuel at the time of the diagnosis. the fuel injection valve (14, 24; 114; 214; 314; 414) injects fuel into a cylinder at a timing at which the fuel does not contribute to combustion of the internal combustion engine to thereby supply unburned fuel to the catalyst; the temperature increase detecting means (51, 52; 61, 62; 153; 253; 353A, 353B; 453; 553) detects an increase in temperature of the catalyst in response to fuel supplied by the fuel addition valve or the fuel injection valve; and the controller comprising diagnostic means (40, 140, 240, 340, 440, 540) that is configured to diagnose whether the catalyst and/or the fuel addition valve are abnormal on the basis of whether the degree of increase in temperature of the catalyst in response to a fuel supply command for supplying fuel, which is output to the fuel addition valve by the diagnostic means, reflects the supplied fuel and whether the degree of increase in temperature of the catalyst in response to a fuel supply command for supplying fuel, which is output to the fuel injection valve by the diagnostic means, reflects the supplied fuel at the time of the diagnosis, wherein