Despite the significance of corporate social responsibility (CSR), there remains an extensive debate regarding its implications for firm value. This study examines the moderating effects of financial flexibility and R&D investment on CSR and firm value. Using multiple archival data of 2311 companies from 2010 to 2016, our study finds that CSR is a “double-edged sword” for firm value; specifically, CSR significantly increases systematic risk but reduces firms’ idiosyncratic risk as well as the Tobin’s q. Besides, the results indicate that financial flexibility and R&D investment significantly reduce the negative correlation between CSR and Tobin’s q, the difference between the two being that financial flexibility can reduce the positive relationship between CSR and system risk, while R&D spending can reduce the negative relationship between CSR and idiosyncratic risk. By adding new aspects to the discussion about how CSR affects firm value, the results speak to both theorists and practitioners.