Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
D
Dnsmasq
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
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
nanahira
Dnsmasq
Commits
294d36df
Commit
294d36df
authored
Jul 06, 2016
by
Simon Kelley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Calculate length of TFTP error reply correctly.
parent
f186bdcb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
2 deletions
+19
-2
CHANGELOG
CHANGELOG
+14
-0
src/tftp.c
src/tftp.c
+5
-2
No files found.
CHANGELOG
View file @
294d36df
version 2.77
Calculate the length of TFTP error reply packet
correctly. This fixes a problem when the error
message in a TFTP packet exceeds the arbitrary
limit of 500 characters. The message was correctly
truncated, but not the packet length, so
extra data was appended. This is a possible
security risk, since the extra data comes from
a buffer which is also used for DNS, so that
previous DNS queries or replies may be leaked.
Thanks to Mozilla for funding the security audit
which spotted this bug.
version 2.76
version 2.76
Include 0.0.0.0/8 in DNS rebind checks. This range
Include 0.0.0.0/8 in DNS rebind checks. This range
translates to hosts on the local network, or, at
translates to hosts on the local network, or, at
...
...
src/tftp.c
View file @
294d36df
...
@@ -652,20 +652,23 @@ static void sanitise(char *buf)
...
@@ -652,20 +652,23 @@ static void sanitise(char *buf)
}
}
#define MAXMESSAGE 500
/* limit to make packet < 512 bytes and definitely smaller than buffer */
static
ssize_t
tftp_err
(
int
err
,
char
*
packet
,
char
*
message
,
char
*
file
)
static
ssize_t
tftp_err
(
int
err
,
char
*
packet
,
char
*
message
,
char
*
file
)
{
{
struct
errmess
{
struct
errmess
{
unsigned
short
op
,
err
;
unsigned
short
op
,
err
;
char
message
[];
char
message
[];
}
*
mess
=
(
struct
errmess
*
)
packet
;
}
*
mess
=
(
struct
errmess
*
)
packet
;
ssize_t
ret
=
4
;
ssize_t
len
,
ret
=
4
;
char
*
errstr
=
strerror
(
errno
);
char
*
errstr
=
strerror
(
errno
);
sanitise
(
file
);
sanitise
(
file
);
mess
->
op
=
htons
(
OP_ERR
);
mess
->
op
=
htons
(
OP_ERR
);
mess
->
err
=
htons
(
err
);
mess
->
err
=
htons
(
err
);
ret
+=
(
snprintf
(
mess
->
message
,
500
,
message
,
file
,
errstr
)
+
1
);
len
=
snprintf
(
mess
->
message
,
MAXMESSAGE
,
message
,
file
,
errstr
);
ret
+=
(
len
<
MAXMESSAGE
)
?
len
+
1
:
MAXMESSAGE
;
/* include terminating zero */
my_syslog
(
MS_TFTP
|
LOG_ERR
,
"%s"
,
mess
->
message
);
my_syslog
(
MS_TFTP
|
LOG_ERR
,
"%s"
,
mess
->
message
);
return
ret
;
return
ret
;
...
...
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