You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/parser/RuntimeASTTransformer.groovy
Copy file name to clipboardExpand all lines: pipeline-model-definition/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/generator/InputDirective.java
+38Lines changed: 38 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -134,6 +134,44 @@ public FormValidation doCheckMessage(@QueryParameter String value) {
// and as we are using html / javascript in places we disallow "'"
155
+
// and to prevent escaping hell disallow "&"
156
+
157
+
// as well as anything unsafe we disallow . and .. (but we can have a dot inside the string so foo.bar is ok)
158
+
// also Jenkins dissallows ; in the request parameter so don't allow that either.
159
+
if (id == null || id.isEmpty()) {
160
+
// the id will be provided by a hash of the message
161
+
returnFormValidation.ok();
162
+
}
163
+
if (id.equals(".")) {
164
+
returnFormValidation.error("The ID is required to be URL safe and is limited to the characters a-z A-Z, the digits 0-9 and additionally the characters ':' '@' '=' '+' '$' ',' '-' '_' '.' '!' '~' '*' '(' ')'.");
165
+
}
166
+
if (id.equals("..")) {
167
+
returnFormValidation.error("The ID is required to be URL safe and is limited to the characters a-z A-Z, the digits 0-9 and additionally the characters ':' '@' '=' '+' '$' ',' '-' '_' '.' '!' '~' '*' '(' ')'.");
168
+
}
169
+
if (!id.matches("^[a-zA-Z0-9[-]._~!$()*+,:@=]+$")) { // escape the - inside another [] so it does not become a range of , - _
170
+
returnFormValidation.error("The ID is required to be URL safe and is limited to the characters a-z A-Z, the digits 0-9 and additionally the characters ':' '@' '=' '+' '$' ',' '-' '_' '.' '!' '~' '*' '(' ')'.");
Copy file name to clipboardExpand all lines: pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/StageInputTest.java
0 commit comments