Uploading SVG images in Self-Service
For security reasons, SVG image files are validated prior to upload.
When a file with file extension SVG is uploaded, the SVG file is validated to see whether it only contains the elements and attributes as found in the whitelist (a specific java file).
In this file, the whitelisted elements and attributes are described.
• whitelisted attributes are:
{
//A
"accent-height", "accumulate", "additive", "alignment-baseline", "allowReorder", "alphabetic", "amplitude", "arabic-form", "ascent", "attributeName", "attributeType", "autoReverse", "azimuth",
//B
"baseFrequency", "baseline-shift", "baseProfile", "bbox", "begin", "bias", "by",
//C
"calcMode", "cap-height", "class", "clip", "clipPathUnits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "contentScriptType", "contentStyleType", "cursor", "cx", "cy",
//D
"d", "decelerate", "descent", "diffuseConstant", "direction", "display", "divisor", "dominant-baseline", "dur", "dx", "dy",
//E
"edgeMode", "elevation", "enable-background", "end", "exponent", "externalResourcesRequired",
//F
"fill", "fill-opacity", "fill-rule", "filter", "filterRes", "filterUnits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "format", "from", "fr", "fx", "fy",
//G
"g1", "g2", "glyph-name", "glyph-orientation-horizontal", "glyph-orientation-vertical", "glyphRef", "gradientTransform", "gradientUnits",
//H
"hanging", "height", "href", "hreflang", "horiz-adv-x", "horiz-origin-x",
//I
"id", "ideographic", "image-rendering", "in", "in2", "intercept",
//K
"k", "k1", "k2", "k3", "k4", "kernelMatrix", "kernelUnitLength", "kerning", "keyPoints", "keySplines", "keyTimes",
//L
"lang", "lengthAdjust", "letter-spacing", "lighting-color", "limitingConeAngle", "local",
//M
"marker-end", "marker-mid", "marker-start", "markerHeight", "markerUnits", "markerWidth", "mask", "maskContentUnits", "maskUnits", "mathematical", "max", "media", "method", "min", "mode",
//N
"name", "numOctaves",
//O
"offset", "opacity", "operator", "order", "orient", "orientation", "origin", "overflow", "overline-position", "overline-thickness",
//P
"panose-1", "paint-order", "path", "pathLength", "patternContentUnits", "patternTransform", "patternUnits", "ping", "pointer-events", "points", "pointsAtX", "pointsAtY", "pointsAtZ", "preserveAlpha", "preserveAspectRatio", "primitiveUnits",
//R
"r", "radius", "referrerPolicy", "refX", "refY", "rel", "rendering-intent", "repeatCount", "repeatDur", "requiredExtensions", "requiredFeatures", "restart", "result", "rotate", "rx", "ry",
//S
"scale", "seed", "shape-rendering", "slope", "spacing", "specularConstant", "specularExponent", "speed", "spreadMethod", "startOffset", "stdDeviation", "stemh", "stemv", "stitchTiles", "stop-color", "stop-opacity", "strikethrough-position", "strikethrough-thickness", "string", "stroke", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke-width", "style", "surfaceScale", "systemLanguage",
//T
"tabindex", "tableValues", "target", "targetX", "targetY", "text-anchor", "text-decoration", "text-rendering", "textLength", "to", "transform", "type",
//U
"u1", "u2", "underline-position", "underline-thickness", "unicode", "unicode-bidi", "unicode-range", "units-per-em",
//V
"v-alphabetic", "v-hanging", "v-ideographic", "v-mathematical", "values", "vector-effect", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "viewBox", "viewTarget", "visibility",
//W
"width", "widths", "word-spacing", "writing-mode",
//X
"x", "x-height", "x1", "x2", "xChannelSelector", "xlink:actuate", "xlink:arcrole", "xlink:href", "xlink:role", "xlink:show", "xlink:title", "xlink:type", "xml:base", "xml:lang", "xml:space", "xmlns", "xmlns:xlink",
//Y
"y", "y1", "y2", "yChannelSelector",
//Z
"z", "zoomAndPan"
};
• whitelisted elements are:
{
//A
"a", "animate", "animateMotion", "animateTransform",
//C
"circle", "clipPath", "color-profile",
//D
"defs", "desc", "discard",
//E
"ellipse",
//F
"feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence", "filter", "foreignObject",
//G
"g",
//H
"hatch", "hatchpath",
//I
"image",
//L
"line", "linearGradient",
//M
"marker", "mask", "mesh", "meshgradient", "meshpatch", "meshrow", "metadata", "mpath",
//P
"path", "pattern", "polygon", "polyline",
//R
"radialGradient", "rect",
//S
"set", "solidcolor", "stop", "style", "svg", "switch", "symbol",
//T
"text", "textPath", "title", "tspan",
//U
"unknown", "use",
//V
"view",
};
If the file to be uploaded is found to contain elements or attributes that are not whitelisted, the file upload is canceled and an error message is displayed.