There are lots of statements out there about Social Security benefits (both retirement and disability) being obtained by both illegal and legal aliens. In order to get these benefits a person must have a valid social security number and meet the following eligibility requirement
Sec. 1614. [42 U.S.C. 1382c](a)(1) For purposes of this title, the term “aged, blind, or disabled individual” means an individual who—
(A) is 65 years of age or older, is blind (as determined under paragraph (2)), or is disabled (as determined under paragraph (3)), and
(B)(i) is a resident of the United States, and is either (I) a citizen or (II) an alien lawfully admitted for permanent residence or otherwise permanently residing in the United States under color of law (including any alien who is lawfully present in the United States as a result of the application of the provisions of section 212(d)(5) of the Immigration and Nationality Act), or
From the Social Security Act
In other words, to be eligible for any Social Security benefits (retirement, disability, survivor, etc) you must be a resident of the United States AND either be a citizen of the United States or a legal alien/permanent residence. (please note that service members and their families living abroad are still considered residents of the United States)
Those in the country illegally, whether it is because they illegally entered the country or because they allowed their legal status to expire, cannot collect benefits.
This is why Social Security asks you to provide your birth certificate or proof of legal residency in the country before paying you any benefits. The media and many myths portray the Social Security process as being rife with fraud, some from those here illegally draining your benefits. This is not the case . Anyone applying for benefits must prove they meet ALL the eligibility requirements, including citizenship/legal status.