Skip to content

Commit

Permalink
fix issue #88: Users able to edit build spec can execute arbitrary java
Browse files Browse the repository at this point in the history
code
  • Loading branch information
robinshine committed Apr 10, 2020
1 parent 4c2cf7a commit 4f5dc6f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion server-core/src/main/java/io/onedev/server/CoreModule.java
Expand Up @@ -60,6 +60,7 @@
import org.hibernate.collection.internal.PersistentBag;
import org.hibernate.exception.ConstraintViolationException;
import org.hibernate.type.Type;
import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.collect.Lists;
Expand Down Expand Up @@ -309,7 +310,10 @@ protected void configure() {

@Override
public ValidatorFactory get() {
Configuration<?> configuration = Validation.byDefaultProvider().configure();
Configuration<?> configuration = Validation
.byDefaultProvider()
.configure()
.messageInterpolator(new ParameterMessageInterpolator());
return configuration.buildValidatorFactory();
}

Expand Down

0 comments on commit 4f5dc6f

Please sign in to comment.