Skip to content

[codex] Merge upstream into fork#5

Merged
dnjg merged 51 commits into
mainfrom
upstream-merge
Apr 12, 2026
Merged

[codex] Merge upstream into fork#5
dnjg merged 51 commits into
mainfrom
upstream-merge

Conversation

@mfow-nullify
Copy link
Copy Markdown

Automated merge branch for syncing Nullify-Platform/opengrep with upstream/main.

This PR is created and updated by the upstream merge automation.

Validation:

  • GitHub Actions on branch/PR
  • Local merge conflict resolution in tainting call-graph code

corneliuhoffman and others added 30 commits March 31, 2026 10:59
Add constructor call resolution to the call graph so that
new ClassName(), ClassName(), and ClassName.new() create edges
to the constructor method (using Lang_config's constructor_names).

Fix object_mappings lookup to use SID-aware comparison, preventing
same-named variables in different scopes from resolving to the
wrong class.

Add type annotation fallback so that method calls on typed
parameters (e.g. Python's `def f(x: ClassName)`) resolve when
object_mappings has no entry.
Extract tok_of_eorig helper to recover source-level tokens from
IL expressions. Call graph edges are keyed by source positions,
but IL construction often creates expressions with synthetic tokens.
The eorig back-pointer preserves the original source position.

Apply this to get_signature_for_object and DRY the simple call path
which already had the same logic inlined.

Also resolve obj.method() patterns in ToSinkInCall effects.
Remove id_resolved guard from mk_class_constructor_name so the IL
New instruction always carries a constructor reference.

In call_with_intrafile, detect constructor calls via the call graph
and remap the callee to obj.Constructor so Sig_inst can instantiate
BThis field effects onto the target variable. Prepend self arg for
Python constructors (which have explicit self in params but not in
call args). Read back the shape from lval_env after ToLval effects
so it propagates through intermediate assignments.
Add tests for Java, Python, and Ruby demonstrating:
- False negative fixed: zero-arg constructors with internal sources
- False positive fixed: constructors ignoring tainted args
- Cross-function flow via type annotations on parameters

Update test_python_constructor.py with type annotation on sink_ex.
Update test_ruby_zero_arg_dispatch.rb todoruleid -> ruleid.
fix: proper constructor taint analysis
Dockerfile: Preprocess for better line continuations and comments
Replace G.OtherParam with G.ParamPattern for OtherParamExpr and
OtherParamPair in the Elixir-to-generic translation. Add
Container(Dict) handling in expr_to_pattern so map patterns convert
to PatList rather than falling through to opaque OtherPat.
Translate the => operator as keyval (Container(Tuple, ...)) instead of
Call(Id("=>"), ...) so arrow pairs share the same structure as keyword
pairs. Wrap map items in OtherExpr("MapPairArrow")/OtherExpr("MapPairKeyword")
to preserve syntax distinction for pattern matching. Add OtherExpr-to-OtherPat
conversion in expr_to_pattern, and unwrap the tags in AST_to_IL for Elixir.
Add dots_arrow_map test for arrow-syntax map patterns. Both tests
include negative cases proving the two forms do not cross-match.
elixir: fix map destructuring in function parameters
The OtherExpr("MapPairArrow"/"MapPairKeyword") wrappers introduced
for map items were opaque to the dict function in AST_to_IL, breaking
taint propagation through map value expressions. Unwrap these tags
so dict entries are processed normally.
elixir: fix taint propagation through map value expressions
…afile (opengrep#638)

* add tests and fix the chaining of methods in all langs

* simplification of access removed tok_of_eorig
…gh-destructuring-structs-in-args

Elixir: Updates to syntax (part 1)
@mfow-nullify mfow-nullify marked this pull request as ready for review April 10, 2026 09:52
@mfow-nullify mfow-nullify marked this pull request as draft April 10, 2026 23:22
@mfow-nullify mfow-nullify marked this pull request as ready for review April 10, 2026 23:22
@mfow-nullify mfow-nullify marked this pull request as draft April 10, 2026 23:25
@mfow-nullify mfow-nullify marked this pull request as ready for review April 10, 2026 23:32
@mfow-nullify mfow-nullify marked this pull request as draft April 11, 2026 02:02
@mfow-nullify mfow-nullify marked this pull request as ready for review April 11, 2026 02:02
@mfow-nullify mfow-nullify marked this pull request as draft April 11, 2026 07:02
@mfow-nullify mfow-nullify marked this pull request as ready for review April 11, 2026 07:03
@mfow-nullify mfow-nullify marked this pull request as draft April 11, 2026 12:02
@mfow-nullify mfow-nullify marked this pull request as ready for review April 11, 2026 12:03
@mfow-nullify mfow-nullify marked this pull request as draft April 11, 2026 17:02
@mfow-nullify mfow-nullify marked this pull request as ready for review April 11, 2026 17:03
@mfow-nullify mfow-nullify marked this pull request as draft April 11, 2026 22:02
@mfow-nullify mfow-nullify marked this pull request as ready for review April 11, 2026 22:03
@mfow-nullify mfow-nullify marked this pull request as draft April 12, 2026 06:40
@mfow-nullify mfow-nullify marked this pull request as ready for review April 12, 2026 06:42
@mfow-nullify mfow-nullify marked this pull request as draft April 12, 2026 08:08
@mfow-nullify mfow-nullify marked this pull request as ready for review April 12, 2026 08:09
@mfow-nullify mfow-nullify marked this pull request as draft April 12, 2026 13:08
@mfow-nullify mfow-nullify marked this pull request as ready for review April 12, 2026 13:08
@mfow-nullify mfow-nullify marked this pull request as draft April 12, 2026 18:03
@mfow-nullify mfow-nullify marked this pull request as ready for review April 12, 2026 18:03
@mfow-nullify mfow-nullify marked this pull request as draft April 12, 2026 23:06
@mfow-nullify mfow-nullify marked this pull request as ready for review April 12, 2026 23:07
@dnjg dnjg merged commit bca4af4 into main Apr 12, 2026
6 checks passed
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.

5 participants