CWE-491 · Słabość
Public cloneable() Method Without Final ('Object Hijack')
- Abstrakcja
- Wariant
- Status
- Szkic
- Dodano
- 19 lipca 2006
- Ostatnia zmiana
- 11 grudnia 2025
Opis
A class has a cloneable() method that is not declared final, which allows an object to be created without calling the constructor. This can cause the object to be in an unexpected state.
Skutki
Integrity, Other
Unexpected State; Varies by Context
Zapobieganie
Implementation
Make the cloneable() method final.
Słabość nadrzędna
Kiedy powstaje
- Implementation
Dotyczy
Java
Źródła
- Seven Pernicious Kingdoms: A Taxonomy of Software Security Errors — Katrina Tsipenyuk, Brian Chess, Gary McGraw, NIST, 2005
- OWASP , Attack Category : Mobile code: object hijack — OWASP
Wpis z katalogu CWE 4.20.