{"record":{"id":"c62fe4485a397476","repo":"spinnaker/spinnaker","slug":"found-field-s-but-rejected-due-to-unsupported-typ","errorCode":null,"errorMessage":"found field %s but rejected due to unsupported type %s","messagePattern":"found field (.+?) but rejected due to unsupported type (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"kork/kork-expressions/src/main/java/com/netflix/spinnaker/kork/expressions/allowlist/FilteredPropertyAccessor.java","lineNumber":55,"sourceCode":"      throw new IllegalArgumentException(\n          format(\"requested getter %s not found on type %s\", propertyName, clazz));\n    } else if (!returnTypeRestrictor.supports(getter.getReturnType())) {\n      throw new IllegalArgumentException(\n          format(\n              \"found getter for requested %s but rejected due to return type %s\",\n              propertyName, getter.getReturnType()));\n    }\n    return getter;\n  }\n\n  @Override\n  protected Field findField(String name, Class<?> clazz, boolean mustBeStatic) {\n    Field field = super.findField(name, clazz, mustBeStatic);\n    if (field == null) {\n      throw new IllegalArgumentException(\n          format(\"requested field %s not found on type %s\", name, clazz));\n    } else if (!returnTypeRestrictor.supports(field.getType())) {\n      throw new IllegalArgumentException(\n          format(\"found field %s but rejected due to unsupported type %s\", name, clazz));\n    }\n    return field;\n  }\n}\n","sourceCodeStart":37,"sourceCodeEnd":61,"githubUrl":"https://github.com/spinnaker/spinnaker/blob/1d4a5d0f6d10d0232b1af077decd559b68a94a5e/kork/kork-expressions/src/main/java/com/netflix/spinnaker/kork/expressions/allowlist/FilteredPropertyAccessor.java#L37-L61","documentation":"FilteredPropertyAccessor.findField found the requested Java field on the type, but the configured returnTypeRestrictor does not allow the field's type, so evaluation is rejected. This is the allowlist doing its job: expressions may only read properties whose return types are permitted.","triggerScenarios":"SpEL expression accesses a field that exists, but whose declared type is not in the allowlist's supported return types (e.g. accessing a raw object/heterogeneous type when only primitives and strings are supported).","commonSituations":"Expressions reading fields recently typed to an unallowed class; overly restrictive expression allowlist configuration in services like clouddriver/orca; authors trying to traverse into nested objects the allowlist deliberately blocks.","solutions":["Rewrite the expression to use a property whose type is allowed","Extend the returnTypeRestrictor configuration to allow the needed type if it is safe to expose","Expose a dedicated safe getter/method returning an allowed type"],"exampleFix":"// before\n${ #target.rawConfig }\n// after\n${ #target.configJson }","handlingStrategy":"validation","validationCode":"// check the field's type is supported before building the expression\nField f = target.getClass().getDeclaredField(\"rawConfig\");\nif (!Set.of(String.class, Integer.class, Boolean.class, List.class).contains(f.getType())) {\n  throw new IllegalArgumentException(\"field type not allowlisted: \" + f.getType());\n}","typeGuard":"boolean isAllowedReturnType(Class<?> type) {\n  return returnTypeRestrictor.supports(type);\n}","tryCatchPattern":null,"preventionTips":["Keep expression allowlists aligned with the properties authors actually use","Document which return types the restrictor supports","Prefer exposing safe wrapper getters over widening the allowlist"],"tags":["spel","expressions","security","allowlist"],"backgroundTag":"permission-denied","analyzedSha":"1d4a5d0f6d10d0232b1af077decd559b68a94a5e","analyzedAt":"2026-09-10T14:13:07.222Z","contentChangedAt":"2026-09-10T14:13:07.222Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}