Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
e0c63e8
add scopes for sign in
spetrescu84 Sep 30, 2026
52e5eb6
Send Native Auth V2 entry scopes and claims with JS token parity
djanardhan98 Oct 12, 2026
5325fa9
Repair unified-error diagnostic forwarding in split controller
djanardhan98 Oct 12, 2026
41f9c0f
Canonicalize only Native Auth V2 OIDC default scopes
djanardhan98 Oct 12, 2026
b41473a
Keep authorize-inputs PR stacked on repaired unified-errors base
djanardhan98 Oct 12, 2026
665e912
Preserve device token results during R8 shrinking, Fixes AB#3784571 (…
mohitc1 Oct 12, 2026
a9ee08c
Review dispatched calls under locks with concrete evidence, AB#377803…
shahzaibj Oct 13, 2026
9b7ceef
Premortem doc for ENABLE_NATIVE_DEVICE_CA_MANAGEMENT_APP_HANDOFF flig…
somalaya Oct 13, 2026
a14a3f5
Handle OpenID VC target-blank navigation (#3299)
somalaya Oct 13, 2026
faa3352
Add Common preprovisioning and combined registration APIs, Fixes AB#3…
mohitc1 Oct 13, 2026
b32f4a2
Make Device-CA authorize-only forwarding default-off, Fixes AB#376645…
Prvnkmr337 Oct 13, 2026
2e49192
Handle marked broker WebView redirects in external browser, Fixes AB#…
somalaya Oct 13, 2026
9294353
Add broker external browser redirect premortem, Fixes AB#3781149 (#3313)
somalaya Oct 14, 2026
42725a4
Add Island Browser SSO signing identities, Fixes AB#3780783 (#3298)
shahzaibj Oct 14, 2026
076482f
Move native ATS caller validation to Broker ingress, AB#3751475, Fixe…
p3dr0rv Oct 14, 2026
98bc54f
Fix AppRegistry test initialization order, Fixes AB#3791209 (#3314)
p3dr0rv Oct 15, 2026
cc25e6e
Preserve Native Auth V2 unified-error diagnostics, Fixes AB#3784695 (…
djanardhan98 Oct 19, 2026
9b436de
Merge dev into Native Auth V2 authorize inputs
djanardhan98 Oct 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@ Escalate to Security if a race compromises auth, tokens, or sensitive data integ

Route changed, added, removed, or moved `synchronized` blocks/methods, Kotlin `@Synchronized`, explicit `Lock`/`withLock`/`Mutex`, and changes to lock expressions, helpers, receivers, or shared-state access paths to deeper concurrency analysis. Include refactors whose diff has no new locking tokens. The presence of synchronization elsewhere in a file is not a finding or a reason to audit unrelated code.

Also route changed interface/abstract calls, concrete overridable-method calls in Java and Kotlin (including Java virtual and Kotlin `open` methods), and synchronous callback/listener/lambda invocations while a lock is held. Include changes to injected implementations, hierarchies, overrides, or callback bodies reached by an unchanged locked caller, even without synchronization keywords in the diff. This is focused routing, not a blanket arbitrary-call-under-lock defect.

### 3.1 What to Flag (Non-Security)
- Unsynchronized mutable shared state accessed across threads/coroutine contexts (lists/maps/caches/flags).
- Lazy init races (double-checked locking lacking `volatile` / `@Volatile`).
Expand Down Expand Up @@ -250,10 +252,12 @@ Do NOT flag:
- Intentional thread confinement (single-thread dispatcher/executor) clearly enforced.
- Read-only data after construction (effectively immutable).
- Generated code with known synchronization wrappers.
- Consistent acquisition order across reachable paths, or same-monitor JVM reentry, without a demonstrated conflicting path.
- Consistent acquisition order across reachable paths, or same-monitor JVM reentry, without a demonstrated conflicting path or invalid intermediate-state access.
- Stable private `final`/`val` monitors used by all relevant accesses; non-final syntax alone is not a concurrency defect.
- Helper extraction retaining the same monitor for every caller, or bounded pure computation on thread-owned inputs moved outside a lock while preserving the protected invariant and ordering.

These suppressions require the changed path to preserve confinement, immutability, or the generated wrapper's protection. A new override/callback that bypasses that boundary is not suppressed.

### 3.8 Lock Identity and Before/After Analysis
- Trace the actual monitor object and aliases, not just lock variable names: an instance synchronized method locks `this`, while a static synchronized method locks the declaring class's `Class` object. Resolve the actual JVM owner for Kotlin `@Synchronized`, including object/companion and static bridges.
- Compare before/after held-lock sets at each affected shared read/write and call boundary. Trace relevant caller/callee acquisitions, release paths, receiver changes, state ownership, visibility, and concurrent reachability. Follow concrete callees to establish lock order, not to speculate about unknown implementations; state any unresolved call/alias boundary and do not claim a proven deadlock beyond it.
Expand All @@ -272,11 +276,21 @@ Do NOT flag:

### 3.11 Refactors and Finding Evidence
- Compare protection before and after a refactor, including a removed `synchronized`/`@Synchronized`, class-to-instance monitor change, different receiver, or helper extraction. Replacing the original caller's monitor with a helper's own monitor does not preserve the original protection.
- Dangerous example: `synchronized nextId()` becomes an unsynchronized wrapper calling an unguarded increment helper; concurrent calls on the same instance can lose updates. Changing a static synchronized method to instance synchronization while retaining shared static state likewise splits protection across instances.
- Dangerous example: Kotlin `@Synchronized fun nextId()` becomes an unannotated wrapper calling an unguarded increment helper; concurrent calls on the same instance can lose updates. The annotation and Java's instance-method `synchronized` hold `this`; changing a static synchronized method to instance synchronization while retaining shared static state likewise splits protection across instances.
- Safe counterexample: the original synchronized entry point calls a private helper under the same monitor, and every other helper caller holds that same monitor across the entire invariant. Do not demand redundant synchronization on the helper.
- Cite a changed line (or the affected call/declaration for removed locking), the concrete monitor identity, conflicting paths/threads, before/after protection, actual impact, and minimal invariant-preserving fix. Apply the existing High/Medium impact criteria; never assign blanket severity based on nested locks, non-final references, or scope size.

See [concurrency examples and counterexamples](skills/code-review/references/concurrency-threading.md) for the corresponding review procedure and compact cases.
### 3.12 Runtime Call Targets and Callbacks Under Locks
- Resolve the concrete held monitors/locks and possible runtime targets through construction, injection, hierarchy, overrides, and callback/lambda wiring. Trace actual callee bodies while the lock remains held, including further acquisitions, blocking/wait dependencies, and access to the caller's invariant. A declared interface/abstract type, a concrete overridable Java or Kotlin method, or a collection name proves neither safety nor a defect.
- Distinguish registration/enqueueing from invocation before release. Verify the dispatcher/executor's behavior: an executor may run inline. An asynchronous callback is not safe merely because it runs elsewhere if the caller waits for it while holding a lock it needs. `join`/`Future.get`/latch waits do not release held monitors; `Object.wait` releases only its target monitor, not other held locks.
- Report runtime-target ABBA only with an actual override/callee taking a second distinct lock and a concurrently reachable reverse path on those same objects. Report a waiting-worker cycle only with the caller's wait and the worker's dependency on the held lock. Reacquiring the same non-reentrant `Mutex` through a callback can self-suspend or fail for a repeated owner token.
- Same-thread JVM monitor reentry itself is benign, but a concrete callback can observe or mutate invalid intermediate state. Name the incomplete invariant, the actual callback access, and the resulting incorrect behavior; complete-state reentry without conflicting accesses is a counterexample.
- For external/native/reflective targets or unresolved injection, stop at the exact missing implementation/contract; do not invent lock edges, assert a safe default, or call it probable/proven deadlock. At most one clearly non-blocking `Sanity check:` contract note is permitted for a changed risk already established locally, such as new uncontrolled callback execution while a shared auth-cache lock is held. Specify the missing contract and local consequence; a generic interface call alone warrants silence. Do not duplicate an existing lock-order finding.
- Suppress known bounded, pure, nonblocking leaves and verified targets. For example, an actual non-escaping standard `ArrayList`'s `size()` or indexed `get()` under its owner guard adds no lock/wait edge; still trace operations invoking element/callback code, such as `contains` calling `equals`. A declared `List`/`Map` can instead dispatch to custom code. Truly deferred callbacks after release with no caller wait are counterexamples when state, ordering, and lifetime remain valid.
- Recommend a snapshot/open call only when state transition or reservation remains atomic under the original guard, the snapshot is immutable, and callback ordering, thread affinity, visibility, resource lifetime, and auth semantics are preserved. Revalidate generation/state or reconcile results after the call where needed. Revalidation alone cannot undo an irreversible operation: establish reservation/ownership and cancellation semantics before starting it; do not introduce duplicate side effects, stale-token/key use, check-then-act splits, or unsafe `volatile` substitutions. A verified consistent lock-order contract can be an alternative; do not mechanically finalize global APIs.
- Cite the changed call or implementation/injection/override/callback line plus the held monitor, actual runtime callee, competing path or invariant access, and concrete impact. Use existing severity criteria; an interface call is not automatically High severity or a merge blocker.

See [concurrency examples and counterexamples](skills/code-review/references/concurrency-threading.md) for the corresponding review procedure and Kotlin-first compact cases. Preserve intended polymorphism with Kotlin `open`/`override` (classes/functions are final by default); retain Java comparisons for virtual-by-default methods and legacy blocking-thread APIs. Translating examples does not justify changing JVM monitors to coroutine mutexes.

--------------------------------------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion .github/skills/code-review/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Use this skill only for pull-request review in `AzureAD/microsoft-authentication
- Always: [comment quality and severity](references/comment-quality-severity.md) and [false-positive suppression](references/false-positive-suppression.md).
- Commands, controllers, OAuth/OIDC, cache, authority, IPC, errors, shared contracts, or downstream consumers: [domain context](references/domain-context.md) and [correctness and API compatibility](references/correctness-api-compatibility.md).
- Authentication, authorization, tokens, claims, logs, telemetry data, feature flags, intents, deserialization, keys, certificates, or cryptography: [security, privacy, and cryptography](references/security-privacy-crypto.md).
- Shared mutable state, executors, threads, coroutines, flows, cancellation, cache updates, or key rotation; changed/added/removed/moved `synchronized` blocks/methods, Kotlin `@Synchronized`, explicit `Lock`/`withLock`/`Mutex`, or modified lock expressions/helpers/receivers/shared-state paths: [concurrency and threading](references/concurrency-threading.md). Follow its [change-driven analysis](references/concurrency-threading.md#lock-identity-and-beforeafter-analysis) even for refactors without new locking tokens; synchronization merely present elsewhere in a file is not a finding.
- Shared mutable state, executors, threads, coroutines, flows, cancellation, cache updates, or key rotation; changed/added/removed/moved `synchronized` blocks/methods, Kotlin `@Synchronized`, explicit `Lock`/`withLock`/`Mutex`, or modified lock expressions/helpers/receivers/shared-state paths: [concurrency and threading](references/concurrency-threading.md). Follow its [change-driven analysis](references/concurrency-threading.md#lock-identity-and-beforeafter-analysis) even for refactors without new locking tokens. Also follow [runtime call targets](references/concurrency-threading.md#runtime-target-trace) for changed interface/abstract calls, concrete overridable calls in Java and Kotlin (including Java virtual and Kotlin `open` methods), injected implementations, hierarchy/override changes, or callback/listener/lambda invocations/bodies reached while a lock is held, even when that caller is unchanged. Synchronization merely present elsewhere in a file, or an interface call alone, is not a finding.
- Java/Kotlin production logic, validation, nullability, collections, serialization, error modeling, or public/shared APIs: [correctness and API compatibility](references/correctness-api-compatibility.md).
- Cache/serialization hot paths, authority discovery, token parsing, allocations, build/dependency files, or resource ownership: [performance, resources, and dependencies](references/performance-resources-dependencies.md).
- OpenTelemetry spans, attributes, status, correlation IDs, `SpanName`, or `AttributeName`: [telemetry and observability](references/telemetry-observability.md).
Expand Down
Loading
Loading