Skip to content

Foxhound: only create TaintOperation for tainted strings#206

Closed
tmbrbr wants to merge 1 commit into
SAP:mainfrom
tmbrbr:unescape-optimize
Closed

Foxhound: only create TaintOperation for tainted strings#206
tmbrbr wants to merge 1 commit into
SAP:mainfrom
tmbrbr:unescape-optimize

Conversation

@tmbrbr

@tmbrbr tmbrbr commented Mar 11, 2024

Copy link
Copy Markdown
Contributor

Some more optimization, this time for unescape operations.

@tmbrbr tmbrbr self-assigned this Mar 11, 2024
@tmbrbr tmbrbr requested a review from leeN March 11, 2024 10:41

@leeN leeN left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread js/src/builtin/String.cpp
if(newtaint.hasTaint()) {
newtaint.extend(op);
if (newtaint.hasTaint()) {
newtaint.extend(TaintOperationFromContext(cx, "unescape", true, str));

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could cause GC problems - if TaintOperationFromContext needs to allocate memory (e.g. by flattening str), then result might be freed as it is not rooted!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could probably mitigate this by moving it up before Step 6

@leeN

leeN commented Sep 12, 2025

Copy link
Copy Markdown
Collaborator

Superseeded by #336.

@leeN leeN closed this Sep 12, 2025
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.

2 participants