Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Kopete
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Network
Kopete
Commits
6243764c
Commit
6243764c
authored
Feb 11, 2017
by
Pali Rohár
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix CVE 2017-5593 (User Impersonation Vulnerability) in jabber protocol
BUG: 376348 FIXED-IN: 16.12.3
parent
afd61266
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
5 deletions
+61
-5
protocols/jabber/libiris/patches/01_cve_2017-5593.patch
protocols/jabber/libiris/patches/01_cve_2017-5593.patch
+52
-0
protocols/jabber/libiris/src/xmpp/xmpp-im/xmpp_tasks.cpp
protocols/jabber/libiris/src/xmpp/xmpp-im/xmpp_tasks.cpp
+9
-5
No files found.
protocols/jabber/libiris/patches/01_cve_2017-5593.patch
0 → 100644
View file @
6243764c
diff --git a/src/xmpp/xmpp-im/xmpp_tasks.cpp b/src/xmpp/xmpp-im/xmpp_tasks.cpp
index 0e74b71..0837548 100644
--- a/src/xmpp/xmpp-im/xmpp_tasks.cpp
+++ b/src/xmpp/xmpp-im/xmpp_tasks.cpp
@@ -888,14 +888,18 @@
bool JT_PushMessage::take(const QDomElement &e)
QDomElement forward;
Message::CarbonDir cd = Message::NoCarbon;
+ Jid fromJid = Jid(e1.attribute(QLatin1String("from")));
// Check for Carbon
QDomNodeList list = e1.childNodes();
for (int i = 0; i < list.size(); ++i) {
QDomElement el = list.at(i).toElement();
- if (el.attribute("xmlns") == QLatin1String("urn:xmpp:carbons:2") && (el.tagName() == QLatin1String("received") || el.tagName() == QLatin1String("sent"))) {
+ if (el.attribute("xmlns") == QLatin1String("urn:xmpp:carbons:2")
+ && (el.tagName() == QLatin1String("received") || el.tagName() == QLatin1String("sent"))
+ && fromJid.compare(Jid(e1.attribute(QLatin1String("to"))), false)) {
QDomElement el1 = el.firstChildElement();
- if (el1.tagName() == QLatin1String("forwarded") && el1.attribute(QLatin1String("xmlns")) == QLatin1String("urn:xmpp:forward:0")) {
+ if (el1.tagName() == QLatin1String("forwarded")
+ && el1.attribute(QLatin1String("xmlns")) == QLatin1String("urn:xmpp:forward:0")) {
QDomElement el2 = el1.firstChildElement(QLatin1String("message"));
if (!el2.isNull()) {
forward = el2;
@@ -904,7 +908,8 @@
bool JT_PushMessage::take(const QDomElement &e)
}
}
}
- else if (el.tagName() == QLatin1String("forwarded") && el.attribute(QLatin1String("xmlns")) == QLatin1String("urn:xmpp:forward:0")) {
+ else if (el.tagName() == QLatin1String("forwarded")
+ && el.attribute(QLatin1String("xmlns")) == QLatin1String("urn:xmpp:forward:0")) {
forward = el.firstChildElement(QLatin1String("message")); // currently only messages are supportted
// TODO <delay> element support
if (!forward.isNull()) {
@@ -913,7 +918,6 @@
bool JT_PushMessage::take(const QDomElement &e)
}
}
- QString from = e1.attribute(QLatin1String("from"));
Stanza s = client()->stream().createStanza(addCorrectNS(forward.isNull()? e1 : forward));
if(s.isNull()) {
//printf("take: bad stanza??\n");
@@ -926,7 +930,7 @@
bool JT_PushMessage::take(const QDomElement &e)
return false;
}
if (!forward.isNull()) {
- m.setForwardedFrom(Jid(from));
+ m.setForwardedFrom(fromJid);
m.setCarbonDirection(cd);
}
protocols/jabber/libiris/src/xmpp/xmpp-im/xmpp_tasks.cpp
View file @
6243764c
...
...
@@ -888,14 +888,18 @@ bool JT_PushMessage::take(const QDomElement &e)
QDomElement
forward
;
Message
::
CarbonDir
cd
=
Message
::
NoCarbon
;
Jid
fromJid
=
Jid
(
e1
.
attribute
(
QLatin1String
(
"from"
)));
// Check for Carbon
QDomNodeList
list
=
e1
.
childNodes
();
for
(
int
i
=
0
;
i
<
list
.
size
();
++
i
)
{
QDomElement
el
=
list
.
at
(
i
).
toElement
();
if
(
el
.
attribute
(
"xmlns"
)
==
QLatin1String
(
"urn:xmpp:carbons:2"
)
&&
(
el
.
tagName
()
==
QLatin1String
(
"received"
)
||
el
.
tagName
()
==
QLatin1String
(
"sent"
)))
{
if
(
el
.
attribute
(
"xmlns"
)
==
QLatin1String
(
"urn:xmpp:carbons:2"
)
&&
(
el
.
tagName
()
==
QLatin1String
(
"received"
)
||
el
.
tagName
()
==
QLatin1String
(
"sent"
))
&&
fromJid
.
compare
(
Jid
(
e1
.
attribute
(
QLatin1String
(
"to"
))),
false
))
{
QDomElement
el1
=
el
.
firstChildElement
();
if
(
el1
.
tagName
()
==
QLatin1String
(
"forwarded"
)
&&
el1
.
attribute
(
QLatin1String
(
"xmlns"
))
==
QLatin1String
(
"urn:xmpp:forward:0"
))
{
if
(
el1
.
tagName
()
==
QLatin1String
(
"forwarded"
)
&&
el1
.
attribute
(
QLatin1String
(
"xmlns"
))
==
QLatin1String
(
"urn:xmpp:forward:0"
))
{
QDomElement
el2
=
el1
.
firstChildElement
(
QLatin1String
(
"message"
));
if
(
!
el2
.
isNull
())
{
forward
=
el2
;
...
...
@@ -904,7 +908,8 @@ bool JT_PushMessage::take(const QDomElement &e)
}
}
}
else
if
(
el
.
tagName
()
==
QLatin1String
(
"forwarded"
)
&&
el
.
attribute
(
QLatin1String
(
"xmlns"
))
==
QLatin1String
(
"urn:xmpp:forward:0"
))
{
else
if
(
el
.
tagName
()
==
QLatin1String
(
"forwarded"
)
&&
el
.
attribute
(
QLatin1String
(
"xmlns"
))
==
QLatin1String
(
"urn:xmpp:forward:0"
))
{
forward
=
el
.
firstChildElement
(
QLatin1String
(
"message"
));
// currently only messages are supportted
// TODO <delay> element support
if
(
!
forward
.
isNull
())
{
...
...
@@ -913,7 +918,6 @@ bool JT_PushMessage::take(const QDomElement &e)
}
}
QString
from
=
e1
.
attribute
(
QLatin1String
(
"from"
));
Stanza
s
=
client
()
->
stream
().
createStanza
(
addCorrectNS
(
forward
.
isNull
()
?
e1
:
forward
));
if
(
s
.
isNull
())
{
//printf("take: bad stanza??\n");
...
...
@@ -926,7 +930,7 @@ bool JT_PushMessage::take(const QDomElement &e)
return
false
;
}
if
(
!
forward
.
isNull
())
{
m
.
setForwardedFrom
(
Jid
(
from
)
);
m
.
setForwardedFrom
(
fromJid
);
m
.
setCarbonDirection
(
cd
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment