Are Social Security benefits taxable in the year to which they are attributed or the year in which they are received?

A December 2018 benefit is typically not paid until January.  Is it taxable in 2018 or 2019?