jenkinsci / jenkinsci/script-security-plugin

[JENKINS-56948] Whitelist Enum.valueOf()

Open
#830 0 comments 0 reactions 0 assignees View on GitHub
component:script-security-plugin imported-jira-issue priority:minor resolution:unresolved
Dominant language
Java
Stars
76
Forks
181
Avg merge
14h 55m
Merged PRs (30d)
3

Description

Using valueOf from known classes (Boolean.valueOf , etc.) are allowed (see source generic-whitelist).

But for custom Enum, we have to approve. Now because we cannot override valueOf, this method is very secure. Because we can't authorize all valueOf from all existing Enum in the world, we could just allow Enum.valueOf(Class enumType, String name).

---
Originally reported by antoinetran, imported from: Whitelist Enum.valueOf()


  • status: Open
  • priority: Minor
  • component(s): script-security-plugin
  • resolution: Unresolved
  • votes: 1
  • watchers: 2
  • imported: 2025-12-09

Raw content of original issue

Using valueOf from known classes (Boolean.valueOf , etc.) are allowed (see source generic-whitelist).

But for custom Enum, we have to approve. Now because we cannot override valueOf, this method is very secure. Because we can't authorize all valueOf from all existing Enum in the world, we could just allow Enum.valueOf(Class<T> enumType, String name).

  • environment: script-security-plugin 1.56 (latest as of now)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.