VYPR
Moderate severityNVD Advisory· Published Sep 8, 2015· Updated May 6, 2026

CVE-2015-5250

CVE-2015-5250

Description

The API server in OpenShift Origin 1.0.5 allows remote attackers to cause a denial of service (master process crash) via crafted JSON data.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
github.com/openshift/originGo
< 1.0.61.0.6

Patches

1
dace5075e31b

Merge pull request #4416 from liggitt/recover_panic

https://github.com/openshift/originOpenShift BotSep 1, 2015via ghsa
5 files changed · +47 18
  • Godeps/_workspace/src/k8s.io/kubernetes/pkg/apiserver/apiserver.go+22 0 modified
    @@ -25,6 +25,7 @@ import (
     	"net"
     	"net/http"
     	"path"
    +	rt "runtime"
     	"strconv"
     	"strings"
     	"time"
    @@ -157,6 +158,27 @@ func InstallLogsSupport(mux Mux) {
     	mux.Handle("/logs/", http.StripPrefix("/logs/", http.FileServer(http.Dir("/var/log/"))))
     }
     
    +func InstallRecoverHandler(container *restful.Container) {
    +	container.RecoverHandler(logStackOnRecover)
    +}
    +
    +//TODO: Unify with RecoverPanics?
    +func logStackOnRecover(panicReason interface{}, httpWriter http.ResponseWriter) {
    +	var buffer bytes.Buffer
    +	buffer.WriteString(fmt.Sprintf("recover from panic situation: - %v\r\n", panicReason))
    +	for i := 2; ; i += 1 {
    +		_, file, line, ok := rt.Caller(i)
    +		if !ok {
    +			break
    +		}
    +		buffer.WriteString(fmt.Sprintf("    %s:%d\r\n", file, line))
    +	}
    +	glog.Errorln(buffer.String())
    +
    +	// TODO: make status unversioned or plumb enough of the request to deduce the requested API version
    +	errorJSON(apierrors.NewGenericServerResponse(http.StatusInternalServerError, "", "", "", "", 0, false), latest.Codec, httpWriter)
    +}
    +
     func InstallServiceErrorHandler(container *restful.Container, requestResolver *APIRequestInfoResolver, apiVersions []string) {
     	container.ServiceErrorHandler(func(serviceErr restful.ServiceError, request *restful.Request, response *restful.Response) {
     		serviceErrorHandler(requestResolver, apiVersions, serviceErr, request, response)
    
  • Godeps/_workspace/src/k8s.io/kubernetes/pkg/apiserver/resthandler.go+10 0 modified
    @@ -29,6 +29,7 @@ import (
     	"k8s.io/kubernetes/pkg/api/rest"
     	"k8s.io/kubernetes/pkg/fields"
     	"k8s.io/kubernetes/pkg/runtime"
    +	"k8s.io/kubernetes/pkg/util"
     	"k8s.io/kubernetes/pkg/util/strategicpatch"
     
     	"github.com/emicklei/go-restful"
    @@ -618,7 +619,14 @@ func finishRequest(timeout time.Duration, fn resultFunc) (result runtime.Object,
     	// when the select statement reads something other than the one the goroutine sends on.
     	ch := make(chan runtime.Object, 1)
     	errCh := make(chan error, 1)
    +	panicCh := make(chan interface{}, 1)
     	go func() {
    +		// panics don't cross goroutine boundaries, so we have to handle ourselves
    +		defer util.HandleCrash(func(panicReason interface{}) {
    +			// Propagate to parent goroutine
    +			panicCh <- panicReason
    +		})
    +
     		if result, err := fn(); err != nil {
     			errCh <- err
     		} else {
    @@ -634,6 +642,8 @@ func finishRequest(timeout time.Duration, fn resultFunc) (result runtime.Object,
     		return result, nil
     	case err = <-errCh:
     		return nil, err
    +	case p := <-panicCh:
    +		panic(p)
     	case <-time.After(timeout):
     		return nil, errors.NewTimeoutError("request did not complete within allowed duration", 0)
     	}
    
  • Godeps/_workspace/src/k8s.io/kubernetes/pkg/master/master.go+1 17 modified
    @@ -17,7 +17,6 @@ limitations under the License.
     package master
     
     import (
    -	"bytes"
     	"fmt"
     	"io/ioutil"
     	"math/rand"
    @@ -26,7 +25,6 @@ import (
     	"net/http/pprof"
     	"net/url"
     	"os"
    -	rt "runtime"
     	"strconv"
     	"strings"
     	"sync"
    @@ -412,24 +410,10 @@ func (m *Master) HandleFuncWithAuth(pattern string, handler func(http.ResponseWr
     func NewHandlerContainer(mux *http.ServeMux) *restful.Container {
     	container := restful.NewContainer()
     	container.ServeMux = mux
    -	container.RecoverHandler(logStackOnRecover)
    +	apiserver.InstallRecoverHandler(container)
     	return container
     }
     
    -//TODO: Unify with RecoverPanics?
    -func logStackOnRecover(panicReason interface{}, httpWriter http.ResponseWriter) {
    -	var buffer bytes.Buffer
    -	buffer.WriteString(fmt.Sprintf("recover from panic situation: - %v\r\n", panicReason))
    -	for i := 2; ; i += 1 {
    -		_, file, line, ok := rt.Caller(i)
    -		if !ok {
    -			break
    -		}
    -		buffer.WriteString(fmt.Sprintf("    %s:%d\r\n", file, line))
    -	}
    -	glog.Errorln(buffer.String())
    -}
    -
     // init initializes master.
     func (m *Master) init(c *Config) {
     	healthzChecks := []healthz.HealthzChecker{}
    
  • Godeps/_workspace/src/k8s.io/kubernetes/pkg/util/util.go+5 1 modified
    @@ -44,14 +44,18 @@ var ReallyCrash bool
     var PanicHandlers = []func(interface{}){logPanic}
     
     // HandleCrash simply catches a crash and logs an error. Meant to be called via defer.
    -func HandleCrash() {
    +// Additional context-specific handlers can be provided, and will be called in case of panic
    +func HandleCrash(additionalHandlers ...func(interface{})) {
     	if ReallyCrash {
     		return
     	}
     	if r := recover(); r != nil {
     		for _, fn := range PanicHandlers {
     			fn(r)
     		}
    +		for _, fn := range additionalHandlers {
    +			fn(r)
    +		}
     	}
     }
     
    
  • pkg/build/util/util.go+9 0 modified
    @@ -34,10 +34,19 @@ func GetBuildName(pod *kapi.Pod) string {
     func GetImageStreamForStrategy(strategy buildapi.BuildStrategy) *kapi.ObjectReference {
     	switch strategy.Type {
     	case buildapi.SourceBuildStrategyType:
    +		if strategy.SourceStrategy == nil {
    +			return nil
    +		}
     		return &strategy.SourceStrategy.From
     	case buildapi.DockerBuildStrategyType:
    +		if strategy.DockerStrategy == nil {
    +			return nil
    +		}
     		return strategy.DockerStrategy.From
     	case buildapi.CustomBuildStrategyType:
    +		if strategy.CustomStrategy == nil {
    +			return nil
    +		}
     		return &strategy.CustomStrategy.From
     	default:
     		return nil
    

Vulnerability mechanics

Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

8

News mentions

0

No linked articles in our index yet.