I don’t know the case law, but Section 1950.5 has some pretty broad phrasing:
As used in this section, “security” means any payment, fee, deposit or charge, including, but not limited to, any payment, fee, deposit, or charge, except as provided in Section 1950.6, that is imposed at the beginning of the tenancy to be used to reimburse the landlord for costs associated with processing a new tenant or that is imposed as an advance payment of rent, used or to be used for any purpose, including, but not limited to, any of the following:
1. The compensation of a landlord for a tenant’s default in the payment of rent.
2. The repair of damages to the premises, exclusive of ordinary wear and tear, caused by the tenant or by a
guest or licensee of the tenant.
3. The cleaning of the premises upon termination of the tenancy necessary to return the unit to the same level
of cleanliness it was in at the inception of the tenancy. The amendments to this paragraph enacted by the act adding this sentence shall apply only to tenancies for which the tenant’s right to occupy begins after January 1, 2003.
4. To remedy future defaults by the tenant in any obligation under the rental agreement to restore, replace, or return personal property or appurtenances, exclusive of ordinary wear and tear, if the security deposit is authorized to be applied thereto by the rental agreement.
That said, there’s also “The landlord may claim of the security only those amounts as are reasonably necessary for the purposes specified in subdivision (b).”