看名字似乎会对对象的某个属性做一些操作,这里的对象 o 和属性名 property 都是可控的,继续往下,一路来到 PropertyUtilsBean 类的 getSimpleProperty 函数:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
// Retrieve the property getter method for the specified property finalPropertyDescriptordescriptor= getPropertyDescriptor(bean, name); if (descriptor == null) { thrownewNoSuchMethodException("Unknown property '" + name + "' on class '" + bean.getClass() + "'" ); } finalMethodreadMethod= getReadMethod(bean.getClass(), descriptor); if (readMethod == null) { thrownewNoSuchMethodException("Property '" + name + "' has no getter method in class '" + bean.getClass() + "'"); }
// Call the property getter and return the value finalObjectvalue= invokeMethod(readMethod, bean, EMPTY_OBJECT_ARRAY); return (value);