Skip to content

nano_attachment: fix crash when the configuration is loaded - #73

Open
jclab-joseph wants to merge 1 commit into
openappsec:mainfrom
jclab-oss:fix/write-dbg
Open

nano_attachment: fix crash when the configuration is loaded#73
jclab-joseph wants to merge 1 commit into
openappsec:mainfrom
jclab-oss:fix/write-dbg

Conversation

@jclab-joseph

@jclab-joseph jclab-joseph commented Aug 18, 2026

Copy link
Copy Markdown

A stray comma between two adjacent string literals ended the configuration log's format string one part early, so "async mode: %u" was passed as the first variadic argument instead of being concatenated onto the format. That shifted every argument by one: the %s for the failure mode received the debug level instead, and printf dereferenced that integer as a pointer.

The attachment died of SIGSEGV inside vsnprintf as soon as the agent connected and configuration first loaded, so it never finished registering. With the debug level at 2, the pointer it walked was 0x2:

        #1 strnlen (s=0x2 <error: Cannot access memory at address 0x2>)
        #2 printf_core (fmt="Successfully loaded configuration. inspection mode: ...")
        #5 write_dbg_impl
        #6 init_attachment_config
        #8 InitNanoAttachment
        ```

A stray comma between two adjacent string literals ended the configuration
log's format string one part early, so "async mode: %u" was passed as the first
variadic argument instead of being concatenated onto the format. That shifted
every argument by one: the %s for the failure mode received the debug level
instead, and printf dereferenced that integer as a pointer.

The attachment died of SIGSEGV inside vsnprintf as soon as the agent connected
and configuration first loaded, so it never finished registering. With the
debug level at 2, the pointer it walked was 0x2:

    openappsec#1 strnlen (s=0x2 <error: Cannot access memory at address 0x2>)
    openappsec#2 printf_core (fmt="Successfully loaded configuration. inspection mode: ...")
    openappsec#5 write_dbg_impl
    openappsec#6 init_attachment_config
    openappsec#8 InitNanoAttachment

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

1 participant