Skip to content

Commit

Permalink
Nil request dereference in ACLExtUser and SourceDomainCheck ACLs (#1931)
Browse files Browse the repository at this point in the history
ACLExtUser-based ACLs (i.e. ext_user and ext_user_regex) dereferenced a
nil request pointer when they were used in a context without a request
(e.g., when honoring on_unsupported_protocol).

SourceDomainCheck-based ACLs (i.e. srcdomain and srcdom_regex) have a
similar bug, although we do not know whether broken slow ACL code is
reachable without a request (e.g., on_unsupported_protocol tests cannot
reach that code until that directive starts supporting slow ACLs). This
change does not start to require request presence for these two ACLs to
avoid breaking any existing configurations that "work" without one.
  • Loading branch information
eduard-bagdasaryan authored and squid-anubis committed Nov 5, 2024
1 parent fff4502 commit 0ef767a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/acl/ExtUser.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class ACLExtUser : public Acl::Node
char const *typeString() const override;
void parse() override;
int match(ACLChecklist *checklist) override;
bool requiresRequest() const override { return true; }
SBufList dump() const override;
bool empty () const override;

Expand Down
6 changes: 5 additions & 1 deletion src/acl/SourceDomain.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ LookupDone(const char *, const Dns::LookupDetails &details, void *data)
{
ACLFilledChecklist *checklist = Filled((ACLChecklist*)data);
checklist->markSourceDomainChecked();
checklist->request->recordLookup(details);
if (checklist->request)
checklist->request->recordLookup(details);
else
debugs(28, 3, "no request to recordLookup()");

checklist->resumeNonBlockingCheck();
}

Expand Down

0 comments on commit 0ef767a

Please sign in to comment.