Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

v3: "General failure, action: 0x..." prints a pointer instead of the action name

Open Beginner friendly
#3,708 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
cpp
Domain
backend, security

Research direction

Start with the three output sites named in src/rules_exceptions.cc and src/rule_with_actions.cc, then run the test/regression_tests reproduction. The issue identifies the pointer formatting and the intended action name; update the affected messages and verify they print names such as chain instead of addresses.

Written by the indexing model from the issue text.

Description

3.x bug

Describe the bug

When SecRuleUpdateActionById is given an action that can't be updated (a configuration-time action such as chain, id, phase, rev, ver, maturity or accuracy), libModSecurity v3 prints a memory address instead of the action's name:

General failure, action: 0x932c545b8 has not expected to be used with UpdateActionByID.

This was reported before in #2625 and closed as completed in 2021, but the code that prints it hasn't changed.

To Reproduce

SecRule REQUEST_HEADERS:User-Agent "@rx ^curl" "id:10,phase:2,pass,log,chain"
    SecRule REQUEST_HEADERS:Accept "@rx \*/\*" "t:none"
SecRuleUpdateActionById 10 "pass,chain"

Seen with test/regression_tests on v3/master (84b59962).

Expected behavior

The message should name the action, e.g. General failure, action: chain has not expected to be used with UpdateActionByID.

Cause

Action::m_name is a std::shared_ptr<std::string>, so std::cout << a->m_name prints the pointer. Writing *a->m_name instead fixes it. The same mistake appears three times:

  • src/rules_exceptions.cc:40 (the "has not expected to be used with UpdateActionByID" message)
  • src/rules_exceptions.cc:51 ("has an unknown type")
  • src/rule_with_actions.cc:127 ("has an unknown type")

Related

All three messages are written straight to std::cout rather than returned through the existing error out-parameter. A connector therefore never sees them in its error log, and the configuration still loads with the action silently dropped. Fixing the pointer is the minimal change. Reporting the problem through error, as a warning or as a load failure, needs a decision, because it would change behavior for configurations shared with v2 that repeat chain in an update. v2 requires repeating chain there; see the "Updating chained rules" note in owasp-modsecurity/documentation#2.

Dominant language
C++
Stars
9.8k
Forks
1.8k
Avg merge
1d 3h
Merged PRs (30d)
16

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from owasp-modsecurity/ModSecurity

All issues in owasp-modsecurity/ModSecurity

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.