Skip to content

Commit 025fbb7

Browse files
committed
GHSL-2023-011: Out-of-bounds read when decoding
Out-of-bounds read when decoding target information (GHSL-2023-011) Fixes defect GHSL-2023-011 found by the GitHub Security Lab team via oss-fuzz. The lenght of the av_pair is not checked properly for two of the elements. In case the lenght is shorter than requires this may cause an out-of-bound read that either reads garbage or may cause a crash by reading unmapped memory. This can be exploited to crash the service causing a DoS. Signed-off-by: Simo Sorce <simo@redhat.com>
1 parent c16100f commit 025fbb7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/ntlm.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -685,11 +685,19 @@ int ntlm_decode_target_info(struct ntlm_ctx *ctx, struct ntlm_buffer *buffer,
685685
break;
686686
case MSV_AV_TIMESTAMP:
687687
if (!av_timestamp) continue;
688+
if (av_len < sizeof(timestamp)) {
689+
ret = ERR_DECODE;
690+
goto done;
691+
}
688692
memcpy(&timestamp, av_pair->value, sizeof(timestamp));
689693
timestamp = le64toh(timestamp);
690694
break;
691695
case MSV_AV_FLAGS:
692696
if (!av_flags) continue;
697+
if (av_len < sizeof(flags)) {
698+
ret = ERR_DECODE;
699+
goto done;
700+
}
693701
memcpy(&flags, av_pair->value, sizeof(flags));
694702
flags = le32toh(flags);
695703
break;

0 commit comments

Comments
 (0)