JSF isn't exactly stripping them out. It's just ignoring them because they are not among the supported/known attributes of the component in question. In case of for example (which renders by default a HTML tag), you can find all supported attributes in the view declaration language (VDL) documentation.
To overcome this, you would need to create a custom component or, better, just a custom renderer which overrides the standard renderer and takes the custom attributes into account.