Skip to content

[DRAFT] Optimize phishing_blue_button_file_sharing#4804

Closed
thunderkatz wants to merge 4 commits into
mainfrom
jkatzman/phishing-blue-button-style-attr-xpath
Closed

[DRAFT] Optimize phishing_blue_button_file_sharing#4804
thunderkatz wants to merge 4 commits into
mainfrom
jkatzman/phishing-blue-button-style-attr-xpath

Conversation

@thunderkatz

Copy link
Copy Markdown
Contributor

Description

Old version ran xpath to grab every anchor, then regexed all html found within that anchor (including display text and subtags) to get styling info. That's a lot more content than we need, so have the xpath do the filter itself on just the anchor's style tag (much simpler, no regex involved)

Associated samples

n/a

Associated hunts

Same results on 14d hunt with 889 matched groups

Screenshot (insights)

n/a

…l anchor subtree

regex.icontains(.raw, ...) scanned each anchor's entire rendered subtree (all
descendant markup), so cost scaled with how much content each button wrapped
rather than link count. This caused a very slow live evaluation on a message
with content-heavy anchors. Checking the anchor's own @Style attribute via an
xpath predicate avoids scanning descendants entirely.
length(body.previous_threads) == 0 OR'd with (A AND (subject.is_reply OR
subject.is_forward OR length(body.previous_threads) > 0)) always reduces to
just length(body.previous_threads) == 0 OR A, since the third disjunct is the
exact negation of the first OR arm: P OR (A AND NOT P) == P OR A. The
subject.is_reply/is_forward checks never affected the result. Verified
equivalent by exhaustive truth-table test across all 32 input combinations.
@github-actions github-actions Bot added the review-needed Indicates that a PR is waiting for review label Jul 6, 2026
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Shared Samples Sync - Action Required

This PR was not automatically synced to shared-samples because the author is not a member of the sublime-security organization.

To enable syncing, an organization member can comment /update-shared-samples on this PR.

Once triggered, the rules will be synced on the next scheduled run (every 10 minutes).

@thunderkatz

Copy link
Copy Markdown
Contributor Author

Closing in favor of #4817

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review-needed Indicates that a PR is waiting for review shared-samples:excluded:author_membership

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant