Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
svgsalamander
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Debian Java Maintainers
svgsalamander
Commits
18318011
Commit
18318011
authored
8 years ago
by
Bas Couwenberg
Browse files
Options
Downloads
Patches
Plain Diff
Add patch by Vincent Privat to fix CVE-2017-5617 (SSRF).
(closes: #853134)
parent
90add006
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
debian/changelog
+8
-0
8 additions, 0 deletions
debian/changelog
debian/patches/0007-CVE-2017-5617-Allow-only-data-scheme.patch
+109
-0
109 additions, 0 deletions
...n/patches/0007-CVE-2017-5617-Allow-only-data-scheme.patch
debian/patches/series
+1
-0
1 addition, 0 deletions
debian/patches/series
with
118 additions
and
0 deletions
debian/changelog
+
8
−
0
View file @
18318011
svgsalamander (1.1.1+dfsg-2) UNRELEASED; urgency=medium
* Team upload.
* Add patch by Vincent Privat to fix CVE-2017-5617 (SSRF).
(closes: #853134)
-- Bas Couwenberg <sebastic@debian.org> Thu, 02 Feb 2017 07:34:57 +0100
svgsalamander (1.1.1+dfsg-1) unstable; urgency=medium
* Team upload.
...
...
This diff is collapsed.
Click to expand it.
debian/patches/0007-CVE-2017-5617-Allow-only-data-scheme.patch
0 → 100644
+
109
−
0
View file @
18318011
Description: Fix CVE-2017-5617: svgSalamander SSRF (Server-Side Request Forgery)
See: http://www.openwall.com/lists/oss-security/2017/01/27/3
Author: Vincent Privat
Origin: https://josm.openstreetmap.de/changeset/11526/josm
Bug: https://github.com/blackears/svgSalamander/issues/11
Bug-Debian: https://bugs.debian.org/853134
--- a/svg-core/src/main/java/com/kitfox/svg/ImageSVG.java
+++ b/svg-core/src/main/java/com/kitfox/svg/ImageSVG.java
@@ -112,21 +112,10 @@
public class ImageSVG extends Renderable
if (getPres(sty.setName("xlink:href")))
{
URI src = sty.getURIValue(getXMLBase());
+ // CVE-2017-5617: Allow only data scheme
if ("data".equals(src.getScheme()))
{
imageSrc = new URL(null, src.toASCIIString(), new Handler());
- } else
- {
- try
- {
- imageSrc = src.toURL();
- } catch (Exception e)
- {
- Logger.getLogger(SVGConst.SVG_LOGGER).log(Level.WARNING,
- "Could not parse xlink:href " + src, e);
-// e.printStackTrace();
- imageSrc = null;
- }
}
}
} catch (Exception e)
@@ -134,32 +123,33 @@
public class ImageSVG extends Renderable
throw new SVGException(e);
}
- diagram.getUniverse().registerImage(imageSrc);
-
- //Set widths if not set
- BufferedImage img = diagram.getUniverse().getImage(imageSrc);
- if (img == null)
+ if (imageSrc != null)
{
- xform = new AffineTransform();
- bounds = new Rectangle2D.Float();
- return;
- }
+ diagram.getUniverse().registerImage(imageSrc);
- if (width == 0)
- {
- width = img.getWidth();
- }
- if (height == 0)
- {
- height = img.getHeight();
- }
+ //Set widths if not set
+ BufferedImage img = diagram.getUniverse().getImage(imageSrc);
+ if (img == null)
+ {
+ xform = new AffineTransform();
+ bounds = new Rectangle2D.Float();
+ return;
+ }
- //Determine image xform
- xform = new AffineTransform();
-// xform.setToScale(this.width / img.getWidth(), this.height / img.getHeight());
-// xform.translate(this.x, this.y);
- xform.translate(this.x, this.y);
- xform.scale(this.width / img.getWidth(), this.height / img.getHeight());
+ if (width == 0)
+ {
+ width = img.getWidth();
+ }
+ if (height == 0)
+ {
+ height = img.getHeight();
+ }
+
+ //Determine image xform
+ xform = new AffineTransform();
+ xform.translate(this.x, this.y);
+ xform.scale(this.width / img.getWidth(), this.height / img.getHeight());
+ }
bounds = new Rectangle2D.Float(this.x, this.y, this.width, this.height);
}
@@ -328,16 +318,14 @@
public class ImageSVG extends Renderable
{
URI src = sty.getURIValue(getXMLBase());
- URL newVal;
+ URL newVal = null;
+ // CVE-2017-5617: Allow only data scheme
if ("data".equals(src.getScheme()))
{
newVal = new URL(null, src.toASCIIString(), new Handler());
- } else
- {
- newVal = src.toURL();
}
- if (!newVal.equals(imageSrc))
+ if (newVal != null && !newVal.equals(imageSrc))
{
imageSrc = newVal;
shapeChange = true;
This diff is collapsed.
Click to expand it.
debian/patches/series
+
1
−
0
View file @
18318011
...
...
@@ -3,3 +3,4 @@
0003-Modify-javadoc-target-to-add-links-to-system-API-doc.patch
0005-dont-call-netbeans-ant-tasks.patch
0006-modify-broken-upstream-pom.patch
0007-CVE-2017-5617-Allow-only-data-scheme.patch
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment