Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libatalk: fix parsing of macOS created AppleDouble files #575

Merged
merged 1 commit into from
Dec 8, 2023

Conversation

rdmark
Copy link
Member

@rdmark rdmark commented Dec 3, 2023

header_len is just AD_DATASZ_OSX which is 82. Pass the size of the AppleDouble file to parse_entries() so the bound checks correctly work with the file size, not just the header size.

With an FinderInfo AppleDouble entry that contains embedded xattrs, the FinderInfo entry will be much larger then 32 bytes, typically it looks like this:

Entry ID : 00000009 : Finder Info
Offset : 00000032 : 50
Length : 00000EB0 : 3760

As offset + length is bigger then FinderInfo, parse_entries() fails the validation.

Signed-off-by: Ralph Boehme slow@samba.org
Reviewed-by: Daniel Markstedt daniel@mindani.net

header_len is just AD_DATASZ_OSX which is 82. Pass the size of the AppleDouble
file to parse_entries() so the bound checks correctly work with the file size,
not just the header size.

With an FinderInfo AppleDouble entry that contains embedded xattrs, the
FinderInfo entry will be much larger then 32 bytes, typically it looks like
this:

Entry ID   : 00000009 : Finder Info
Offset     : 00000032 : 50
Length     : 00000EB0 : 3760

As offset + length is bigger then FinderInfo, parse_entries() fails the
validation.

Signed-off-by:    Ralph Boehme <slow@samba.org>
Reviewed-by:      Daniel Markstedt <daniel@mindani.net>
Copy link

sonarcloud bot commented Dec 3, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

warning The version of Java (11.0.17) you have used to run this analysis is deprecated and we will stop accepting it soon. Please update to at least Java 17.
Read more here

@rdmark rdmark merged commit a0d2bb9 into main Dec 8, 2023
5 checks passed
@rdmark rdmark deleted the rdmark-issue-270 branch December 8, 2023 01:42
@rdmark rdmark restored the rdmark-issue-270 branch December 8, 2023 06:57
@rdmark rdmark deleted the rdmark-issue-270 branch December 8, 2023 07:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants